phetsims/quadrilateral

Sound fluctuates after turning off Voicing on iPad

Closed this issue · 9 comments

Test device
iPad 9th generation

Operating System
iOS 16.3.1

Browser
safari

Problem description
For phetsims/qa#923, after turning off Voicing the Shape Sounds will fade in and out.

Steps to reproduce

  1. Move a side/corner to begin sound
  2. Before sound fades, turn on Play Shape Sounds Forever
  3. Turn on Voicing
  4. Turn off Voicing and exit Preferences

Visuals
Here is what is sounds like after the steps above:

SoundFlux.mov
Troubleshooting information: !!!!! DO NOT EDIT !!!!! Name: ‪Quadrilateral‬ URL: https://phet-dev.colorado.edu/html/quadrilateral/1.0.0-dev.76/phet/quadrilateral_all_phet.html Version: 1.0.0-dev.76 2023-03-28 17:13:45 UTC Features missing: applicationcache, applicationcache, touch Flags: pixelRatioScaling User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Safari/605.1.15 Language: en-US Window: 1342x705 Pixel Ratio: 2/1 WebGL: WebGL 1.0 GLSL: WebGL GLSL ES 1.0 (1.0) Vendor: WebKit (WebKit WebGL) Vertex: attribs: 16 varying: 30 uniform: 1024 Texture: size: 16384 imageUnits: 16 (vertex: 16, combined: 32) Max viewport: 16384x16384 OES_texture_float: true Dependencies JSON: {}

It also fluctuates when Voicing is on and nothing is being read.

Thanks @Nancy-Salpepi - Just in case, I tried on Win 10 Chrome but did not see it there so Ill try on iOS. This is probably a common code problem with audio ducking + speech synthesis (phetsims/tambo#167)

I am able to reproduce this with iOS 15.0.2 Safari. I could not reproduce this in macOS 11.7.2 Safari.

I found it. It is caused by this workaround that was added for Chromebooks: https://github.com/phetsims/utterance-queue/blob/36fdea460883369af36712e1aefef89bf2e25e0d/js/SpeechSynthesisAnnouncer.ts#L472-L483

What must be happening is that iOS has built-in audio ducking for speech synthesis. That is why removing PhET's audio ducking didn't change the behavior. The empty string in that workaround still triggers the ducking even though there is no speech.

I am guessing this was also introduced when the workaround string became an empty space for phetsims/friction#328.

I just noticed that this is a problem for all iOS browsers, not just Safari. So if we opt out of that workaround we need it to be for all iOS which we don't currently have a check for in platform.js.

A fix has been proposed in phetsims/utterance-queue#110. @Nancy-Salpepi can you please test again and confirm this is fixed?

The sound sounds fixed in master. haha 🙃

Excellent, thanks!