Written in RubyMotion. Based on the level meters in Apple's Speak Here example app.
@meter = AudioMeterView.alloc.initWithFrame frame
view.addSubview(@meter)
@meter.input = @audioRecorderAudioMeterView takes as input an AVAudioRecorder or any other object that responds to
updateMetersand either
averagePowerForChannel(channel)
peakPowerForChannel(channel)or
averagePower
peakPowerThe latter methods are used if they exist. Otherwise the former methods are called, with a channel of 0 unless you explicitly set the AudioMeterView's channel attribute.
The meter begins displaying when you set the AudioMeterView's input to an appropriate object. When you set input to nil, the meter lights gradually fall to zero.
