0

Ich verwende Apple's RosyWriter Beispiel zum Aufzeichnen von Video und Audio. Jetzt muss ich Audio mit Bluetooth-Headset aufnehmen, aber es funktioniert nicht für mich. Ich tue die unten stehende Arbeit für diesenVerwenden Sie Bluetooth-Gerät zur Aufnahme von Audio in AVCaptureSession

captureSession = [[AVCaptureSession alloc] init]; 
    /* 
* Create audio connection 
*/ 
if(SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0")){ 
    [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord withOptions:AVAudioSessionCategoryOptionAllowBluetooth error:nil]; 
    captureSession.usesApplicationAudioSession = true; 
    captureSession.automaticallyConfiguresApplicationAudioSession = true; 

} 
AVCaptureDevice *audioDevice = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeAudio]; 
// AVCaptureDeviceInput *audioIn = [[AVCaptureDeviceInput alloc] initWithDevice:[self audioDevice] error:nil]; 
AVCaptureDeviceInput *audioIn = [[AVCaptureDeviceInput alloc] initWithDevice:audioDevice error:nil]; 

if ([captureSession canAddInput:audioIn]) 
    [captureSession addInput:audioIn]; 

Ich habe folgte auch diese question

Antwort

0

ich in der Lage war, dies zu tun, indem Sie die Einstellungen Audio-Ausgang wie unten zu verändern.

_audioCompressionSettings = [[audioOut recommendedAudioSettingsForAssetWriterWithOutputFileType:AVFileTypeQuickTimeMovie] copy];