我正在使用AVAudiofoundation進行錄音,音頻存儲和播放正常,但我的問題是我必須錄製多個音頻,並且必須在表格中顯示,現在我我只能獲取一個網址。請幫我找到解決方案。保存多個錄音音頻文件並獲取所有錄音音頻
該按鈕顯示爲暫停的錄音,我想在這裏,我想要做一些事情對我的問題
- (IBAction)recordPauseTapped:(id)sender
{
// Stop the audio player before recording
if (player.playing)
{
[player stop];
}
if (!recorder.recording)
{
AVAudioSession *session = [AVAudioSession sharedInstance];
[session setActive:YES error:nil];
// Start recording
[recorder record];
[recordPauseButton setTitle:@"Pause" forState:UIControlStateNormal];
}
else
{
// Pause recording
[recorder pause];
[recordPauseButton setTitle:@"Record" forState:UIControlStateNormal];
}
[stopButton setEnabled:YES];
[playButton setEnabled:NO];
}
這個按鈕是停止錄製
- (IBAction)stopTapped:(id)sender
{
[recorder stop];
AVAudioSession *audioSession = [AVAudioSession sharedInstance];
[audioSession setActive:NO error:nil];
NSString *urr=[recorder.url absoluteString];
[recordeddata addObject:urr];
}
此按鈕用於播放錄製的音頻
- (IBAction)playTapped:(id)sender {
if (!recorder.recording)
{
player = [[AVAudioPlayer alloc] initWithContentsOfURL:recorder.url error:nil];
[player setDelegate:self];
[player play];
[_tableview reloadData];
}
}
您可以分享您保存文件的代碼,並訪問音頻文件,上面的代碼與文件獲取無關。 – Saif 2015-02-10 14:36:44
我再次公佈,請參閱下請 – 2015-02-10 15:08:24