iOS:不断更新拱门中的音频表级别(averagePowerForChannel)

时间:2015-06-25 04:51:47

标签: ios avaudioplayer avaudiorecorder

我需要在充满颜色的圆弧中显示音频测光。如果声级低,则应填充最小面积。它应该根据记录器返回的averagePowerForChannel不断填充颜色。请提出一些建议。

1 个答案:

答案 0 :(得分:0)

使用CAShapeLayer,其值在路径更新时会更新

- (void)setAveragePowerForChannel:(CGFloat)averagePowerForChannel {

    _averagePowerForChannel = averagePowerForChannel;

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

    meterLayer.path = path.CGPath;

}