Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/common-app/src/examples/Record/Record.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const Record: FC = () => {
AudioManager.setAudioSessionOptions({
iosCategory: 'playAndRecord',
iosMode: 'spokenAudio',
iosOptions: ['allowBluetooth', 'defaultToSpeaker'],
iosOptions: ['allowBluetoothHFP', 'defaultToSpeaker'],
});

recorderRef.current = new AudioRecorder({
Expand Down
5 changes: 3 additions & 2 deletions packages/audiodocs/docs/system/audio-manager.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function App() {
AudioManager.setAudioSessionOptions({
iosCategory: 'playback',
iosMode: 'default',
iosOptions: ['allowBluetooth', 'allowAirPlay'],
iosOptions: ['allowBluetoothHFP', 'allowAirPlay'],
})

// set info for track to be visible while device is locked
Expand Down Expand Up @@ -230,7 +230,8 @@ type IOSOption =
| 'duckOthers'
| 'allowAirPlay'
| 'mixWithOthers'
| 'allowBluetooth'
| 'allowBluetoothHFP'
| 'bluetoothHighQualityRecording'
| 'defaultToSpeaker'
| 'allowBluetoothA2DP'
| 'overrideMutedMicrophoneInterruption'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,12 @@ - (void)setAudioSessionOptions:(NSString *)category
sessionOptions |= AVAudioSessionCategoryOptionMixWithOthers;
}

if ([option isEqualToString:@"allowBluetooth"]) {
sessionOptions |= AVAudioSessionCategoryOptionAllowBluetooth;
if ([option isEqualToString:@"allowBluetoothHFP"]) {
sessionOptions |= AVAudioSessionCategoryOptionAllowBluetoothHFP;
}

if (@available(iOS 26.0, *) && [option isEqualToString:@"bluetoothHighQualityRecording"]) {
sessionOptions |= AVAudioSessionCategoryOptionBluetoothHighQualityRecording;
}

if ([option isEqualToString:@"defaultToSpeaker"]) {
Expand Down
3 changes: 2 additions & 1 deletion packages/react-native-audio-api/src/system/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ export type IOSOption =
| 'duckOthers'
| 'allowAirPlay'
| 'mixWithOthers'
| 'allowBluetooth'
| 'allowBluetoothHFP'
| 'bluetoothHighQualityRecording'
| 'defaultToSpeaker'
| 'allowBluetoothA2DP'
| 'overrideMutedMicrophoneInterruption'
Expand Down
Loading