phetsims / fourier-making-waves

"Fourier: Making Waves" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
6 stars 3 forks source link

Sim launches without sound in Studio using Chrome #217

Closed Nancy-Salpepi closed 2 years ago

Nancy-Salpepi commented 2 years ago

Test device MacBook Air (m1 chip)

Operating System 12.0.1

Browser Chrome

Problem description When testing https://github.com/phetsims/phet-io/issues/1626 in master: In the Studio wrapper, if I launch the sim with sound on, the sim launches without the sound. I need to click somewhere on the screen in order for the sound to be initiated. In the State wrapper, when setting the state, the downstream sim has sound, although sometimes it is very low.

With Mac + safari--the sound works as in should in both wrappers.

As per MK's recommendation, I am not assigning to any developer at this time.

Steps to reproduce In Studio (with chrome):

  1. Go to the discrete screen
  2. In the Fourier Series portion of the panel, check the box for sound
  3. Press 'preview sim' --The sim will launch without sound
  4. Click anywhere on the screen--the sound will turn on

Visuals

https://user-images.githubusercontent.com/87318828/153529255-44631d01-2912-4b82-9a8e-084c955f2963.mov

KatieWoe commented 2 years ago

Tested this on Windows 11. I saw this bug on Chrome but it did not seem to happen on Firefox.

zepumph commented 2 years ago

I need to click somewhere on the screen in order for the sound to be initiated.

This is part of Chrome's audio policy, a user must interact with a sim in order for it to convey sound (or any audio for that matter). This also applies to voicing responses with SpeechSynthesis, as well as auto playing a video, etc. I recommend closing this issue, but I want to make sure QA is aware of this, and can document it as needed. See https://developer.chrome.com/blog/autoplay/ for details.

Nancy-Salpepi commented 2 years ago

I updated the Sound portion under Section 4.4 of the QA book to include the information in https://github.com/phetsims/fourier-making-waves/issues/217#issuecomment-1051140400.