R – iPhone – show audio record feedback using AVAudioRecorder

avaudiorecorderiphone

I am using the AVAudioRecorder class to record to a wav file. I would like to implement a recording feedback (like the SpeakHere example) which shows the recording level.

I did go through the SpeakHere sample but could not understand how the recording level was changed. Can someone please guide me as to what needs to be done?

Thanks.

Best Answer

If you are using AVAudioRecorder, you might want to just use the following to get the power levels:

- (float)peakPowerForChannel:(NSUInteger)channelNumber
- (void)updateMeters

Those give you the values to graph. There are simpler ways to graph those values, but to see how the SpeakHere sample does it, see their README:

AQLevelMeter.h
AQLevelMeter.mm

The AQLevelMeter class defines the level meter view for the applcation, displaying the metering data from an AudioQueue object

LevelMeter.h
LevelMeter.m

LevelMeter is a base metering class, providing simple functionality for displaying level data

GLLevelMeter.h
GLLevelMeter.m

GLLevelMeter is a subclass of LevelMeter that uses OpenGL for drawing

AQRecorder.h
AQRecorder.m
Related Topic