0

これは iPhone 関連の質問です。openAL を使用してサウンドを再生します (ゲイン、ピッチなどを管理する必要があります)。再生しているものを録音したいのですが、AVAudioRecorder を使用していますが、「prepareToRecord」を実行すると、openAL がオーディオの再生を停止します。どうしたの?私が使用する IBAction のレコードは次のとおりです。

- (IBAction) record: (id) sender
{
NSError *error;
    NSMutableDictionary *settings = [NSMutableDictionary dictionary];
    [settings setValue: [NSNumber numberWithInt:kAudioFormatLinearPCM] forKey:AVFormatIDKey];
    [settings setValue: [NSNumber numberWithFloat:8000.0] forKey:AVSampleRateKey];
    [settings setValue: [NSNumber numberWithInt: 1] forKey:AVNumberOfChannelsKey]; 
    [settings setValue: [NSNumber numberWithInt:16] forKey:AVLinearPCMBitDepthKey];
    [settings setValue: [NSNumber numberWithBool:NO] forKey:AVLinearPCMIsBigEndianKey];
    [settings setValue: [NSNumber numberWithBool:NO] forKey:AVLinearPCMIsFloatKey];
    NSURL *url = [NSURL fileURLWithPath:FILEPATH];
    self.recorder = [[AVAudioRecorder alloc] initWithURL:url settings:settings error:&error];
    self.recorder.delegate = self;
    self.recorder.meteringEnabled = YES;
    [self.recorder prepareToRecord];
    [self.recorder record];
}

ありがとう

編集:

AudioQueueの録音も試しました。今回は、次のコードの後、音が停止します。

status = AudioQueueEnqueueBuffer(recordState.queue, recordState.buffers[i], 0, NULL);

ということはopenALでiPhoneのプレイを録画することは可能でしょうか???

再度、感謝します

4

1 に答える 1

0

FILEPATH は、別のファイルが再生されているパスと同じです...? と が同じ場所から呼び出された場合...実際recordprepareToRecordは呼び出す必要はありませんprepareToRecord...record仕事をします...参照

http://developer.apple.com/iphone/library/documentation/AVFoundation/Reference/AVAudioRecorder_ClassReference/Reference/Reference.html#//apple_ref/occ/instm/AVAudioRecorder/prepareToRecord

于 2010-04-09T10:21:35.527 に答える