2013-05-29 2 views
0

DIYCam을 사용하여 비디오를 녹화하고 블루투스 헤드셋의 오디오 경로를 오디오 입력으로 설정하려고하지만 라우팅이 작동하지 않는 것처럼 보입니다. 내가 아는 바로는 오디오 입력을 내 블루투스 헤드셋으로 라우팅하면 DIYCam에 대해 아무 것도 변경할 필요가 없습니다. 맞습니까?iOS - 오디오 입력으로 블루투스 헤드셋을 사용하여 비디오를 기록하는 방법은 무엇입니까?

보기 내가 DIYCam 인스턴스를 생성로드 : 여기 내 코드입니다

- (void)viewDidLoad 
{ 
    [super viewDidLoad]; 
    // Do any additional setup after loading the view from its nib. 

    [self.navigationController setNavigationBarHidden:YES]; 

    self.camera = [[DIYCam alloc] initWithFrame:self.view.bounds]; 
    self.camera.delegate = self; 
    [self.camera setupWithOptions:nil]; // Check DIYAV.h for options 
    [self.camera setCamMode:DIYAVModeVideo]; 
    [self.view addSubview:self.camera]; 
    [self.view sendSubviewToBack:self.camera]; 

    if(self.bluetoothInput) { 
     [self setBluetoothAudioInput]; 
    } 
} 

이 내 블루투스 라우팅 기능입니다 :

- (void)setBluetoothAudioInput 
{ 
    // create and set up the audio session 
    AVAudioSession* audioSession = [AVAudioSession sharedInstance]; 
    [audioSession setDelegate:self]; 
    [audioSession setCategory:AVAudioSessionCategoryRecord error:nil]; 
    [audioSession setActive:YES error:nil]; 

    // set up for bluetooth microphone input 
    UInt32 allowBluetoothInput = 1; 
    OSStatus stat = AudioSessionSetProperty (
              kAudioSessionProperty_OverrideCategoryEnableBluetoothInput, 
              sizeof (allowBluetoothInput), 
              &allowBluetoothInput 
              ); 
} 

그리고 이러한 시작을 stoping의 IBActions 있습니다 :

- (IBAction)startRecording:(id)sender 
{ 
    [self.camera startSession]; 
    [self.camera captureVideoStart]; 
} 

- (IBAction)stopRecording:(id)sender 
{ 
    [self.camera captureVideoStop]; 
    [self.camera stopSession]; 
} 

답변

0

나는 사용자가 수동으로 사용할 입력 장치를 설정해야한다고 생각합니다. f 또는 오디오. 방금 비슷한 문제가 있었고 showsVolumeSlider 부울을 NO로 설정하여 MPVolumeView를 사용했습니다. 이것은 클릭 가능한 버튼을 제공하여 사용 가능한 목록에서 원하는 입력을 설정합니다.

체크 아웃 : AudioSession input from bluetooth output to line out or speaker

0

이 시도 :

[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord withOptions:AVAudioSessionCategoryOptionAllowBluetooth error:nil]; 
관련 문제