# Full duplex Bluetooth

**URL:** <https://forum.juce.com/t/full-duplex-bluetooth/10669>\
**Category:** MacOSX and iOS\
**Created:** [June 25, 2013, 10:24am UTC](https://forum.juce.com/t/full-duplex-bluetooth/10669 "2013-06-25T10:24:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![billythekid](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/billythekid/32/88_2.png) [@billythekid](https://forum.juce.com/u/billythekid)\
**Post date:** [June 25, 2013, 10:24am UTC](https://forum.juce.com/t/full-duplex-bluetooth/10669/1 "2013-06-25T10:24:44Z")

</div>

Using JUCE, I can only select bluetooth as an option from the MPVolumeView when the audio inputs are disabled. How do I get full duplex operation (I don’t mind if the sample rate drops to 8kHz).

---

<div class="post-metadata">

**Author:** ![billythekid](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/billythekid/32/88_2.png) [@billythekid](https://forum.juce.com/u/billythekid)\
**Post date:** [July 5, 2013, 2:10pm UTC](https://forum.juce.com/t/full-duplex-bluetooth/10669/2 "2013-07-05T14:10:12Z")

</div>

Fixed it. There is a small error in the juce iOS code. You need to set kAudioSessionProperty\_OverrideCategoryEnableBluetoothInput after the kAudioSessionCategory\_PlayAndRecord has been set, otherwise it will not register . .

```auto
        UInt32 audioCategory = kAudioSessionCategory_MediaPlayback;

        if (numInputChannels > 0 && audioInputIsAvailable)
        {
            audioCategory = kAudioSessionCategory_PlayAndRecord;

// UInt32 allowBluetoothInput = 1;
// AudioSessionSetProperty (kAudioSessionProperty_OverrideCategoryEnableBluetoothInput,
// sizeof (allowBluetoothInput), &allowBluetoothInput);
        }

        AudioSessionSetProperty (kAudioSessionProperty_AudioCategory, sizeof (audioCategory), &audioCategory);
        
        if (numInputChannels > 0 && audioInputIsAvailable) 
        {            
            UInt32 allowBluetoothInput = 1;
            AudioSessionSetProperty (kAudioSessionProperty_OverrideCategoryEnableBluetoothInput,
                                     sizeof (allowBluetoothInput), &allowBluetoothInput);     
        }
```

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [July 5, 2013, 2:14pm UTC](https://forum.juce.com/t/full-duplex-bluetooth/10669/3 "2013-07-05T14:14:01Z")

</div>

Ah! Thanks so much for spotting that! I’ll get it sorted out…

---

<div class="post-metadata">

**Author:** ![billythekid](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/billythekid/32/88_2.png) [@billythekid](https://forum.juce.com/u/billythekid)\
**Post date:** [July 5, 2013, 3:00pm UTC](https://forum.juce.com/t/full-duplex-bluetooth/10669/4 "2013-07-05T15:00:19Z")

</div>

The problem with this is that the deviceManager will not fire a change message when bluetooth is selected, and so I cannot see a way of getting a notification about the sample rate change.

One option is to fire off an audioDeviceError on routing change to stop the audio device, but this blows a bit.

Any suggestions? I see a similar thread talking about external rate changes in this section of the forum.
