iDevGames Forums
AVAudioPlayer peakPowerForChannel decibel - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Game Programming Fundamentals (/forum-7.html)
+--- Thread: AVAudioPlayer peakPowerForChannel decibel (/thread-8365.html)



AVAudioPlayer peakPowerForChannel decibel - sefiroths - Dec 1, 2010 09:42 AM

i have some doubt about this method. i report what is in library peakPowerForChannel:
A floating-point representation, in decibels, of a given audio channel’s current peak power. A return value of 0 dB indicates full scale, or maximum power; a return value of -160 dB indicates minimum power (that is, near silence).

If the signal provided to the audio player exceeds ±full scale, then the return value may exceed 0 (that is, it may enter the positive range).

i have made some tests, the maximum (0) is returned very soon, i say a letter with normal voice, and 0 is very soon reached...
if i shout laud 0 is returned...

another doubt is this:
http://it.wikipedia.org/wiki/Decibel

90dB is a shout, 60dB a conversation...so...what is the value returned?
dB what?
"If the signal provided to the audio player exceeds ±full scale, then the return value may exceed 0 (that is, it may enter the positive range)."
i was not able to make it go over 0...

thanks


RE: AVAudioPlayer peakPowerForChannel decibel - AndyKorth - Dec 1, 2010 10:38 AM

The decibel is a _relative_ unit. The English wikipedia says:

"The decibel is commonly used in acoustics to quantify sound levels relative to a 0 dB reference which has been defined as a sound pressure level of .0002 microbar"

And that's consistent with these examples:
http://en.wikipedia.org/wiki/Sound_pressure#Examples_of_sound_pressure_and_sound_pressure_levels

That page has a big list of sounds and their _relative_ volumes. I'm not sure how the decibel is portrayed on the Italian page, since I can't read it.

I guess the main thing to understand is that higher values returned from that method will mean a louder volume, but they are purposefully not providing a reference value. It's not so much to be used as a volume checking device... but instead to measure relative volume.


RE: AVAudioPlayer peakPowerForChannel decibel - sefiroths - Dec 3, 2010 07:41 AM

(Dec 1, 2010 10:38 AM)AndyKorth Wrote:  I guess the main thing to understand is that higher values returned from that method will mean a louder volume, but they are purposefully not providing a reference value. It's not so much to be used as a volume checking device... but instead to measure relative volume.

ok, but at this point, i have -160 as a minimum (silence), 0 as max...
it's ok for me but the max is reached as i talk.
i'd like to have something like:
-160 noone is talking
-100 somone is talking
-50 somone is shouting
0 someone is shouting laud

while i have now
-160 silence
0 somone is talking

can i make something similar?


RE: AVAudioPlayer peakPowerForChannel decibel - AndyKorth - Dec 3, 2010 11:45 AM

I guess you might want to compare peakPowerForChannel and averagePowerForChannel. See if talking and shouting return the same values for the average power. Perhaps while talking, there's a very tiny peak that goes up to 0.


RE: AVAudioPlayer peakPowerForChannel decibel - sefiroths - Dec 6, 2010 01:38 AM

tried but doesn't work...
averagePowerForChannel if i record my voice and then i go up with my voice volume, it goes avarege volume goes up a bit, because i was silent for more time...
is there a way to change audio level controls for mic?


RE: AVAudioPlayer peakPowerForChannel decibel - sefiroths - Dec 7, 2010 01:14 AM

can i change the mic volume to have an input lower than it is in reality?