mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-02-01 03:10:06 +00:00
iOS audio fix for bluetooth headsets.
This commit is contained in:
parent
f55c716ce8
commit
4caac78a0e
1 changed files with 10 additions and 2 deletions
|
|
@ -99,8 +99,16 @@ public:
|
|||
|
||||
AudioSessionSetActive (true);
|
||||
|
||||
UInt32 audioCategory = audioInputIsAvailable ? kAudioSessionCategory_PlayAndRecord
|
||||
: kAudioSessionCategory_MediaPlayback;
|
||||
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);
|
||||
AudioSessionAddPropertyListener (kAudioSessionProperty_AudioRouteChange, routingChangedStatic, this);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue