2

I am working on a "test your hearing application".

I know that half the amplitude is -6db.

I would like to know that when 1.0 is maximum volume using the AVAudioPlayer class, will setting the volume to 0.5 means that it plays at 50%, meaning a drop in relative db to -6db, if we used an ideal earphone?

Benjamin
  • 618
  • 2
  • 6
  • 17
  • possible duplicate of [iPhone - AVAudioPlayer - convert decibel level into percent](http://stackoverflow.com/questions/1512131/iphone-avaudioplayer-convert-decibel-level-into-percent) – Brad Larson Feb 06 '12 at 17:32
  • Also, as Paul indicates in response to [How can I calculate audio dB level?](http://stackoverflow.com/questions/2445756/how-can-i-calculate-audio-db-level), this will probably require calibration for the specific audio hardware you're using (both iOS device and type of headphones). – Brad Larson Feb 06 '12 at 17:34
  • @BradLarson Thanks you for commenting. While it seems that one can get the average db value from the player, there is nothing about the actual hardware. What i would like to know is whatever or not setting the volume between 0.0 to 1.0 is a linear expression or follows some curve. I am not talking about the actual sound produced by the headphone as they are not linear, normally not even close, but the actual analog headphone amp output. – Benjamin Feb 07 '12 at 12:32

1 Answers1

1

That is an excellent question.

I wouldn't be surprised if the range in AVAudioPlayer more closely matches that of the "standard leveling scale" for popular music.

enter image description here

Notice here that 0dB is pretty far up linearly in the range. This is based on the history of the VU meter as described in Level Practices (Part 2) and seen in this picture:

enter image description here

So, I don't know for sure, but my guess would be that AVAudioPlayer more closely matches these ranges. You could always plug headphone jack of our iOS device into an application like Audacity, Logic, or Pro Tools and actually measure the signal coming out of your app as you sweep through the volume range in AVAudioPlayer.

Nick Haddad
  • 8,767
  • 3
  • 34
  • 38
  • Yes I was thinking about doing this. But I would have to create a dummy load (a resistor in parallel?) with the same impedance as the headphones (which btw are not totally flat from 0 to 20k hz). That way I could sweep from 0 to 20k hz while sweeping the volume. – Benjamin Feb 07 '12 at 12:39