question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Setting Audio config to allowsRecordingIOS routes playback audio to headphones only

See original GitHub issue

When i set the global Audio Audio.setAudioModeAsync({ allowsRecordingIOS: true ... }); then all sounds are redirected to the Headphones on IOS. This issue was described already in the forums (https://forums.expo.io/t/try-to-use-expo-audio-ios-play-with-receiver-but-not-speaker/699/13) but it seems has never been transferred to the issues.

As a workaround, i set it globally to false, and when i want to record stuff, i set it to true, and afterwards back. But actually that should not be the case. Tested on an IphoneX with IOs 12.1

Steps to reproduce set on app start the audio to Audio.setAudioModeAsync({ allowsRecordingIOS: true ... });

playback a video with the <video> tag. check that audio is not played through the speakers (no matter if headphones are there or not) but only when the headphone is connected through the headphone.

Expected behaviour Sound can be played through the speakers and recorded at the same time.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
HERRKINcommented, May 23, 2019

Any workaround?

0reactions
sjchmielacommented, Nov 4, 2019

This is an expected behavior of the iOS system. An appropriate note is already added to the docs:

NOTE: when this flag is set to true, playback may be routed to the phone receiver instead of to the speaker.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Responding to Audio Session Route Changes
AVPlayer monitors your app's audio session and responds appropriately to route changes. When users connect headphones, playback continues as expected.
Read more >
Audio - Expo Documentation
On iOS, audio playback and recording in background is only available in standalone apps, and it requires some extra configuration. On iOS, each...
Read more >
How can I tell Windows to route music through a Bluetooth ...
In the Bluetooth settings panel, pair the headset with your computer. · Open the Sound control panel.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found