Trying to understand AVAudioPlayer and audio level metering
问题 I'm trying to understand AVAudioPlayer and audio level metering. What I have below is an object "AudioPlayer" that is playing a short audio sound. Now I want to output the power of this sound (decibels). Somehow I don't think I'm doing this right. audioPlayer.meteringEnabled = YES; [audioPlayer play]; int channels = audioPlayer.numberOfChannels; [audioPlayer updateMeters]; for (int i=0; i<channels; i++) { //Log the peak and average power NSLog(@"%d %0.2f %0.2f", i, [audioPlayer