RESOLVED CONFIGURATION CHANGED237322
webaudio api is muted when the iOS ringer is muted
https://bugs.webkit.org/show_bug.cgi?id=237322
Summary webaudio api is muted when the iOS ringer is muted
Derk-Jan Hartman
Reported 2022-03-01 06:33:20 PST
1. Set your iPhone to silent with the side toggle 2. Play an <audio> or <video> element. Both are audible 3. Try to use anything with WebAudio API. AudioContext/AudioBufferSourceNode/Webaudio API is muted. This is a difference in the channel used by the APIs. Audio and video element are on the media channel, where webaudio seems to be on the default/ringer channel of iOS. This is HIGHLY confusing. I cannot count the amount of times where I have begun playback using webaudio and figured the webpage had broken, only to figure out that because I always have my phone set to Silent, the audio is muted. There are even workaround for this in the wild, where people play a clip of silence using <audio> on loop, to open up the media audio channel and force the mixer to merge both audio sources and output the webaudio api to the media channel. WebAudio API should either: 1. use the media channel (as it already requires a user interaction to unmute, I'm not sure why it would NOT be on the media channel) 2. at the very least present some visual feedback indicating that audio is muted because the ringer is muted. I hope this can be fixed. Wikipedia tracking ticket: https://phabricator.wikimedia.org/T301741
Attachments
Radar WebKit Bug Importer
Comment 1 2022-03-08 06:34:15 PST
Derk-Jan Hartman
Comment 2 2022-04-07 11:24:01 PDT
Wikipedia has applied the mentioned workaround as well now. But a proper fix would be appreciated as this is rather suboptimal and impacts performance. var el = document.createElement( 'audio' ); el.src = 'silence.mp3'; // media file with tiny bit of silence el.play(); context = new AudioContext();
Brent Fulgham
Comment 3 2022-06-23 15:46:16 PDT
This is actually being tracked here: rdar://43514261
Adrian Holovaty
Comment 4 2023-03-30 07:17:44 PDT
This comes up so often for our customers at Soundslice that we made a dedicated help page for the issue: https://www.soundslice.com/help/en/player/troubleshooting/235/no-sound-on-ios/
Carlos J.
Comment 5 2024-04-09 11:45:48 PDT
The workaround also means the lock-screen will display media-controls for the silent file running in the background. Which is highly confusing for users.
Jean-Yves Avenard [:jya]
Comment 6 2024-09-25 14:54:52 PDT
Since iOS 17, you can set the audio session type to "playback". Add in your code something like `navigator.audioSession.type = "playback"` and audio will not be suspended. By default the type is `ambient` and so audio will be muted if the phone is muted.
Note You need to log in before you can comment on or make changes to this bug.