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];
}