views:

154

answers:

1

Hi everyone.

I'm now creating an Application using speech recognition.To check the Audio Power coming in through the microphone, I wrote a method as follows.

-(void)checkPower(AudioqueRef)queue{
   UInt32 expectedSize= sizeof(AudioQueueLevelMeterState);
   AudioQueueGetProperty(queue,
                     kAudioQueueProperty_CurrentLevelMeter,
                     audioLevels,          
                        expectedSize);
   NSLog(@"average:%f peak:%f",audioLevels.mAveragePower,audioLevels.mPeakPower);
}

I found that sometimes mAveragePower was larger than mPeakPower, and when mAveragePower was 1.0, in other words, averagePower is regarded as max, mPeakPower was lower than 1.0.

I think that generally this result is inpossible. please Let me know if you have any information about sound power on CoreAudio.

thanks.

A: 

I think mPeakPower means channel power at CURRENT moment & mAveragePower - average channel power for ALL record time, and if it's right your result possible.

Ruslan