is possible receive audio input iphone's built-in microphone, , play audio through bluetooth headset, @ same time?
my goal use built-in microphone input device, if output device headset, because built-in microphone more convenient in use cases.
i know how achieve goal when output device wired headset, 1 comes bundled iphone. plug wired headset in, , call following method:
- (void)selectbuiltinmicrophone { avaudiosession *session = [avaudiosession sharedinstance]; (avaudiosessionportdescription *port in session.availableinputs) if ([port.porttype isequaltostring:avaudiosessionportbuiltinmic]) { nserror *error; [session setpreferredinput:port error:&error]; break; } } by calling above method, input device switched wired headset's microphone iphone's built-in microphone, while output device remains unaffected, iphone record built-in microphone , play through wired headset. expect.
the problem is, method not work when headset bluetooth one. if connect bluetooth headset iphone, call above method, built-in microphone becomes input device, great, output device changed iphone's receiver, bad.
it seems input , output of bluetooth headset locked together: either use both of them, or use none of them. goal impossible? or there exists way overcome apparent limitation?
it not possible receive audio input iphone's built-in microphone, , play audio through bluetooth headset, @ same time
- there prevention can use walkie-talkie .
- you have create 2 sessions . means while recording audio have enable audio session recordandplay.
- while playing have set option audiosession (allowingbluetooth) .
- while recording have set recordandplay.
Comments
Post a Comment