今、私はAVAudioRecorder
で最初に録音された.wavファイルを再生しようとしていて、AVAudioPlayer
でこのサウンドを再生しています。これは十分に簡単だと思われますが、私はAVAudioRecorder
を停止させずに一時停止します。それは何らかの理由でAVAudioPlayer
がレコーダーで開かれているファイルを再生するのを拒否するという問題です。AVAudioPlayerでAVAudioRecorderで録音したファイルを再生する
recorder = [[AVAudioRecorder alloc] initWithURL:url settings:settings error:&error];
[recorder record];
*record for some time*
[recorder stop];
player = [[AVAudioPlayer alloc] initWithContentsOfURL:[self copySoundFileURL] error:nil];
[player play];
をしかし、私はこのようにそれを呼び出すとき、それは仕事をしたい:これは動作します
recorder = [[AVAudioRecorder alloc] initWithURL:url settings:settings error:&error];
[recorder record];
*record for some time*
[recorder pause];
player = [[AVAudioPlayer alloc] initWithContentsOfURL:[self copySoundFileURL] error:nil];
[player play];
(これらは例ofcourseのです)
誰もが道を知っていれば基本的に私の質問です次のいずれかを実行します。
- レコーダーで開いているファイルを再生します。
- レコーダーを停止し、ファイルを再生してから、同じファイルでレコーディングを再開します(以前に記録されたものを失うことはありません)。
すべての情報や考えを歓迎します。