我将如何UIProgressView
在我的 AVAudioRecorder 录制时增加进度计数器?我不确定在哪里增加progressview
...
开始和结束录制的代码:
- (IBAction)beginRecording:(id)sender {
if (player.playing) {
[player stop];
}
AVAudioSession *session = [AVAudioSession sharedInstance];
[session setActive:YES error:nil];
// Start recording
[recorder recordForDuration:8];
[_recordButton setTitle:@"Recording..." forState:UIControlStateNormal];
}
- (IBAction)endRecording:(id)sender {
// logic to stop recording
[recorder stop];
AVAudioSession *audioSession = [AVAudioSession sharedInstance];
[audioSession setActive:NO error:nil];
[_recordButton setTitle:@"Record" forState:UIControlStateNormal];
player = [[AVAudioPlayer alloc] initWithContentsOfURL:recorder.url error:nil];
[player setDelegate:self];
[player play];
}