<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>237322</bug_id>
          
          <creation_ts>2022-03-01 06:33:20 -0800</creation_ts>
          <short_desc>webaudio api is muted when the iOS ringer is muted</short_desc>
          <delta_ts>2024-09-25 14:54:52 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Web Audio</component>
          <version>Safari 15</version>
          <rep_platform>iPhone / iPad</rep_platform>
          <op_sys>iOS 15</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Derk-Jan Hartman">hartman.wiki</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>adrian+webkit</cc>
    
    <cc>bfulgham</cc>
    
    <cc>carlosj-webkit-bugzilla</cc>
    
    <cc>cdumez</cc>
    
    <cc>chrisguttandin</cc>
    
    <cc>ddp.bkdn</cc>
    
    <cc>jean-yves.avenard</cc>
    
    <cc>jer.noble</cc>
    
    <cc>mattwindwer</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1847007</commentid>
    <comment_count>0</comment_count>
    <who name="Derk-Jan Hartman">hartman.wiki</who>
    <bug_when>2022-03-01 06:33:20 -0800</bug_when>
    <thetext>1. Set your iPhone to silent with the side toggle
2. Play an &lt;audio&gt; or &lt;video&gt; 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 &lt;audio&gt; 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&apos;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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1849232</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-03-08 06:34:15 -0800</bug_when>
    <thetext>&lt;rdar://problem/89964986&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1859339</commentid>
    <comment_count>2</comment_count>
    <who name="Derk-Jan Hartman">hartman.wiki</who>
    <bug_when>2022-04-07 11:24:01 -0700</bug_when>
    <thetext>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( &apos;audio&apos; );
el.src = &apos;silence.mp3&apos;; // media file with tiny bit of silence
el.play();
context = new AudioContext();</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1877948</commentid>
    <comment_count>3</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2022-06-23 15:46:16 -0700</bug_when>
    <thetext>This is actually being tracked here:
rdar://43514261</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1945329</commentid>
    <comment_count>4</comment_count>
    <who name="Adrian Holovaty">adrian+webkit</who>
    <bug_when>2023-03-30 07:17:44 -0700</bug_when>
    <thetext>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/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2027211</commentid>
    <comment_count>5</comment_count>
    <who name="Carlos J.">carlosj-webkit-bugzilla</who>
    <bug_when>2024-04-09 11:45:48 -0700</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2063137</commentid>
    <comment_count>6</comment_count>
    <who name="Jean-Yves Avenard [:jya]">jean-yves.avenard</who>
    <bug_when>2024-09-25 14:54:52 -0700</bug_when>
    <thetext>Since iOS 17, you can set the audio session type to &quot;playback&quot;.

Add in your code something like `navigator.audioSession.type = &quot;playback&quot;` and audio will not be suspended.

By default the type is `ambient` and so audio will be muted if the phone is muted.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>