iPhone - AVAudioPlayer - convert decibel level into percent
I like to update an existing iPhone application which is using AudioQueue for playing audio files. The levels (peakPowerForChannel, averagePowerForChannel) were linear form 0.0f to 1.0f. Now I like to use the simpler class AVAudioPlayer which works fine, the only issue is that the levels which are now in decibel, not linear from -120.0f to 0.0f. Has anyone a formula to convert it back to the linear values between 0.0f and 1.0f? Thanks Tom Several Apple examples use the following formula to convert the decibels into a linear range (from 0.0 to 1.0): double percentage = pow (10, (0.05 * power));