iOS : Update audio meter level (averagePowerForChannel) in an arch continously

226 views Asked by At

I need to show the audio metering in an arc filled with color. If the sound level is low, it should fill minimum area. It should continuously do filling the colors according to the averagePowerForChannel returned from recorder. Please give some suggestions.

1

There are 1 answers

0
olynoise On BEST ANSWER

Use a CAShapeLayer whose path is updated when the value changes

- (void)setAveragePowerForChannel:(CGFloat)averagePowerForChannel {

    _averagePowerForChannel = averagePowerForChannel;

    UIBezierPath * path = //... make a path based on the incoming data

    meterLayer.path = path.CGPath;

}