Measure dB with AVAudioRecorder is limited to 96dB on iOS -
i'm trying build db measurement unlock feature within app. feature should become available once user reaches 100db. current implementation able measure 96db. understand problem somehow related bitrate recording: 16bit capable of 96db, 24bit should capable of 144db (http://www.head-fi.org/t/415361/24bit-vs-16bit-the-myth-exploded).
the db measurement , calculations work fine, issue can not measure more 96db. i'm struggeling settings achieve higher bit rate, guess i'm doing wrong here.
my current initialisation of recorder looks this:
nsdictionary *settings = [nsdictionary dictionarywithobjectsandkeys: [nsnumber numberwithfloat: 44100.0], avsampleratekey, [nsnumber numberwithint: kaudioformatappleima4], avformatidkey, [nsnumber numberwithint: 1], avnumberofchannelskey, //[nsnumber numberwithint: 24], avencoderbitratekey, [nsnumber numberwithint:24],avlinearpcmbitdepthkey, [nsnumber numberwithbool:no],avlinearpcmisbigendiankey, [nsnumber numberwithbool:no],avlinearpcmisfloatkey, [nsnumber numberwithint: avaudioqualitymax], avencoderaudioqualitykey, nil]; nserror *error; recorder = [[avaudiorecorder alloc] initwithurl:outputfileurl settings:settings error:&error];
thank in advance.
it's important understand db
value expression of ratio, not absolute value. in case it's magnitude of signal relative smallest value, 16 bit signed value have 20 * log10(2^16) = 96 db
. in other words loudest signal 96 db louder smallest signal. 24 bit data range bigger: 20 * log10(2^24) = 144 db
. full scale signal still same value. (note more commonly use full scale reference of 0 db
, , express other values negative db
values, reference arbitrary).
a common source of confusion when people talk how loud sound is, "db" referring db spl, way of defining loudness relative given reference value (20 µpa (rms)). not confuse db
values calculating above, simple ratios, , not directly related loudness.
Comments
Post a Comment