Keep in mind that there are many different meanings of the word "deciBel". This is a means of representing a certain quantity (such as intensity / power / volume) relative to a control point. For audio signals inside the equipment or in the audio application, there is a peak level of 0 dB. When sound is emitted from the speaker, the perceived volume is measured as the Sound Pressure Level , often described as “dB (SPL)” (or weighted options such as dBA). When you see value tables, such as 100 dB rock concerts, then this is described by SPL. This measurement in itself is relative to the reference level.
So what will be available in the API is the audio data buffer, from which you can easily get the sound level in terms of the raw signal (which has a maximum of 0 dB). However, you cannot easily convert this to physical volume, because it will be hardware dependent. This will differ between one phone model and the next, and will depend on the headphones. The only way to do this is to calibrate the phone by measuring with the SPL indicator, but then it will give you a result that will only give reasonable results on this particular phone.
the_mandrill
source share