Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This little test worked for me... it involves setting up the bluetooth headset as the input also (not sure if that's what you want). Sorry about the crappy formatting on the 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); AudioServicesCreateSystemSoundID (soundFileURLRef,&amp;soundFileObject); AudioServicesPlaySystemSound (soundFileObject); // should play into headset </code></pre> <p>Hope that helps!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

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