Bug 236942 - Unexpected web audio behaviour (sound for a second after unmute, and others)
Summary: Unexpected web audio behaviour (sound for a second after unmute, and others)
Status: REOPENED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Audio (show other bugs)
Version: Safari 16
Hardware: iPhone / iPad iOS 16
: P2 Normal
Assignee: Nobody
URL: https://www.gingerbeardman.com/webkit...
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-02-20 13:14 PST by Matt Sephton
Modified: 2023-09-10 03:10 PDT (History)
5 users (show)

See Also:


Attachments
example web game showing the problem (423.38 KB, application/zip)
2022-02-20 13:14 PST, Matt Sephton
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Sephton 2022-02-20 13:14:02 PST
Created attachment 452700 [details]
example web game showing the problem

The attached/linked code uses Webkit Audio. 

- On Desktop it plays fine and as expected.
- On some iOS devices this may also be the case.
- However, on most iOS devices it *seems* to not play sound.

On closer inspection the problem is more subtle:
1. there is one second or so of music when the phone is unmuted, but then it cuts out again
2. there is sound on the attract mode of the game
   - if there is no sound in attract mode try muting and unmuting the phone
   - to see attract mode play a game and die
   - attract mode notes:
     - no music here
     - no
3. there is full sound in an iOS screen recording of the game

Test device:
- iPhone SE 2020
- iOS 15.3.1

Hosted example code (same as attached zip):
https://www.gingerbeardman.com/webkit/audio/

Source code repo containing the above:
https://github.com/gingerbeardman/good-old-game-sound-generator

As mentioned on Twitter:
https://twitter.com/xeenon/status/1494678426803785731
source of the thread:
https://twitter.com/abagames/status/1494591825365331970
Comment 1 Radar WebKit Bug Importer 2022-02-23 15:35:48 PST
<rdar://problem/89382304>
Comment 2 Brent Fulgham 2022-06-23 15:30:53 PDT
We believe that this is fixed since iOS 15.4 and beyond.
Comment 3 Matt Sephton 2022-06-23 15:43:40 PDT
Sorry to disagree. I'm on iOS 15.5 and the problem and symptoms as listed in the original issue are all still present. I just checked at the link I provided
Comment 4 Matt Sephton 2022-06-23 15:44:07 PDT
Reopening.
Comment 5 Brent Fulgham 2022-06-23 17:24:23 PDT
Understood -- thank you for confirming. Routing now.
Comment 6 Jean-Yves Avenard [:jya] 2022-12-21 17:03:21 PST
Sorry for the delay in looking into it.

I can't reproduce on an iPhone 14 Max Pro nor an iPhone SE (2022) on iOS 16.1.2

Background music plays Audio and sound effects are being heard when you strike enemy ships.

Could you please try again?

Thanks.
Comment 7 Jean-Yves Avenard [:jya] 2022-12-21 18:46:07 PST
Could reproduce on my daughter's iPhone 8 running iOS 16.2. Audio can be heard when you switch the mute button off/on but only for a second or so
Comment 8 Matt Sephton 2022-12-27 06:40:23 PST
I can still reproduce on my SE 2020, on both 16.1.2 and 16.2. 

Not sure how long I'll have this phone.
Comment 9 Matt Sephton 2023-03-28 08:41:51 PDT
I'm now using an iPhone Xs, running iOS 16.4 (released yesterday), and still can still repro this problem.
Comment 10 Matt Sephton 2023-05-19 13:50:26 PDT
iPhone Xs, running iOS 16.5 (released yesterday), I still can still repro this problem with the example URL.
Comment 11 Matt Sephton 2023-09-10 03:10:23 PDT
Also happens on these pages: 

- https://sfxr.me
- https://pro.sfxr.me

I'm running 16.6.1 on iPhone Xs.