How to get the exact decibel level using Cocoa?

We create an application that records ambient sound and takes the necessary action if the sound crosses the specified Decibel.

To achieve the goal of the application, we use the following method from AudioQueueObject.h

- (void) getAudioLevels: (Float32 *) levels peakLevels: (Float32 *) peakLevels {

UInt32 propertySize = audioFormat.mChannelsPerFrame * sizeof (AudioQueueLevelMeterState);
AudioQueueGetProperty(
self.queueObject,
(AudioQueuePropertyID)kAudioQueueProperty_CurrentLevelMeterDB,
self.audioLevels,
&propertySize);

levels[0] = self.audioLevels[0].mAveragePower;
peakLevels[0] = self.audioLevels[0].mPeakPower;
}

We have the following set of queries

  • The recorded sound shows the value in Decibel starting at -60. This value increases when the sound becomes louder. The maximum value recorded by this object is 0.0000. Please explain to us how to interpret these values.

according to the documentation which says that the values ​​we get are in digital decibels that need to be converted to analog, please suggest if there is any way to do this.

early

+3
2

, decibel: , (. Decibel). , .

, kAudioQueueProperty_CurrentLevelMeterDB, dBFS ( ). dBFS - , 0 , (1.0 , 32767 16- ..), . , 0,5 -6 dBFS, 20 * log10 (0,5/1,0) = -6,02

, dBFS ( ) dBu dB SPL ( - dBu 0,775 RMS dB SPL 20 ).

SPL , 20 * log10 , . , , , , ..

, dBFS - , , - dBu dB SPL .

, , , , . , , .

+11

( 32767 -32768 CD- +1,0 -1,0 ). , Cocoa .

. 0 , , , +1,0 -1,0. (, , ). -20 .1, , +0.1 -0.1. -40 0,01, -60 .001.

+1

Source: https://habr.com/ru/post/1715229/


All Articles