私は、オーディオレコードを作成して同時に再生しようとしています。ここにコードがあります。後で録画して再生するだけです。私はスピーカーで同時に再生したい。助けてください。私は正しいクラスを使用しているとは確信していません。録音と同時にオーディオを再生
AVAudioSession * audioSession = [AVAudioSession sharedInstance];
[audioSession setCategory:AVAudioSessionCategoryPlayAndRecord error:nil];
[audioSession setActive:YES error:nil];
temporaryRecFile = [NSURL fileURLWithPath:[NSTemporaryDirectory() stringByAppendingPathComponent:[NSString stringWithString:@"VoiceFile"]]];
recorder = [[AVAudioRecorder alloc] initWithURL:temporaryRecFile settings:nil error:nil];
[recorder setDelegate:self];
[recorder prepareToRecord];
[recorder record];
AVAudioPlayer * player = [[AVAudioPlayer alloc] initWithContentsOfURL:temporaryRecFile error:nil];
player.volume = 1;
[player play];
これを解決しましたか? –