Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>i just review your issue and got nice answer something you want try with Bellow code:-</p> <pre><code>// create and set up the audio session AVAudioSession* audioSession = [AVAudioSession sharedInstance]; [audioSession setDelegate:self]; [audioSession setCategory: AVAudioSessionCategoryPlayAndRecord error: nil]; [audioSession setActive: YES error: nil]; // set up for bluetooth microphone input UInt32 allowBluetoothInput = 1; OSStatus stat = AudioSessionSetProperty ( kAudioSessionProperty_OverrideCategoryEnableBluetoothInput, sizeof (allowBluetoothInput), &amp;allowBluetoothInput ); NSLog(@"status = %x", stat); // problem if this is not zero // check the audio route UInt32 size = sizeof(CFStringRef); CFStringRef route; OSStatus result = AudioSessionGetProperty(kAudioSessionProperty_AudioRoute, &amp;size, &amp;route); NSLog(@"route = %@", route); // if bluetooth headset connected, should be "HeadsetBT" // if not connected, will be "ReceiverAndMicrophone" // now, play a quick sound we put in the bundle (bomb.wav) CFBundleRef mainBundle = CFBundleGetMainBundle(); CFURLRef soundFileURLRef; SystemSoundID soundFileObject; soundFileURLRef = CFBundleCopyResourceURL (mainBundle,CFSTR ("bomb"),CFSTR ("wav"),NULL); NSError *error = nil; audioRecorder = [[AVAudioRecorder alloc] initWithURL:soundFileURLRef settings:recordSettings error:&amp;error]; if (error) { NSLog(@"error: %@", [error localizedDescription]); } else { [audioRecorder prepareToRecord]; } </code></pre> <p>Credit goes to <a href="https://stackoverflow.com/questions/2375837/how-to-route-iphone-audio-to-the-bluetooth-headset">This</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload