Bug 237322 - webaudio api is muted when the iOS ringer is muted
Summary: webaudio api is muted when the iOS ringer is muted
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Audio (show other bugs)
Version: Safari 15
Hardware: iPhone / iPad iOS 15
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-03-01 06:33 PST by Derk-Jan Hartman
Modified: 2024-04-09 11:45 PDT (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Derk-Jan Hartman 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
Comment 1 Radar WebKit Bug Importer 2022-03-08 06:34:15 PST
<rdar://problem/89964986>
Comment 2 Derk-Jan Hartman 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();
Comment 3 Brent Fulgham 2022-06-23 15:46:16 PDT
This is actually being tracked here:
rdar://43514261
Comment 4 Adrian Holovaty 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/
Comment 5 Carlos J. 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.