phetsims / john-travoltage

"John Travoltage" is an educational simulation in HTML5, by PhET Interactive Simulations.
http://phet.colorado.edu/en/simulation/john-travoltage
GNU General Public License v3.0
4 stars 8 forks source link

Arm not moving freely once voicing is activated (specifically with Samantha voice) #438

Closed Nancy-Salpepi closed 3 years ago

Nancy-Salpepi commented 3 years ago

Test device iMac

Operating System 10.15.7

Browser chrome 92.0.4515.107

Problem description https://github.com/phetsims/qa/issues/676

Once the voicing is activated with Samantha chosen, the arm movement/sound becomes slow and choppy. This doesn't occur with any other voice and I don't see this issue using my MacBook 11.4.

Steps to reproduce

  1. Select preferences
  2. Open the audio tab
  3. Turn on audio and select the first 2 sim voicing choices
  4. Change the rate to 1.25x and the voice to Samantha
  5. Move the arm using the mouse

Visuals

https://drive.google.com/file/d/1Vc348PqQU9TT9c6AOAS7FbRqQMNyD_57/view?usp=sharing

Troubleshooting information: !!!!! DO NOT EDIT !!!!! Name: ‪John Travoltage‬ URL: https://phet-dev.colorado.edu/html/john-travoltage/1.6.0-rc.1/phet/john-travoltage_all_phet.html Version: 1.6.0-rc.1 2021-07-22 18:05:38 UTC Features missing: applicationcache, applicationcache, touch User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36 Language: en-US Window: 1852x875 Pixel Ratio: 1/1 WebGL: WebGL 1.0 (OpenGL ES 2.0 Chromium) GLSL: WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.0 Chromium) Vendor: WebKit (WebKit WebGL) Vertex: attribs: 16 varying: 31 uniform: 1024 Texture: size: 16384 imageUnits: 16 (vertex: 16, combined: 80) Max viewport: 16384x16384 OES_texture_float: true Dependencies JSON: {}

jessegreenberg commented 3 years ago

This looks to me like a performance problem with that voice.

jessegreenberg commented 3 years ago

One thing I can try is to reduce the frequency at which we create utterances for the synth. If that is already limited it isn't clear what we can do to improve performance of voices provided by the browser.

jessegreenberg commented 3 years ago

I confirmed that the frequency at which we request speech is limited. In fact, we don't even request speech until the arm stops moving generally. The performance loss illustrated in the video above is during arm drag, so it seems like we may be able to prevent something from happening during arm motion that would improve performance.

jessegreenberg commented 3 years ago

Im confused...It looks like we shouldn't be doing any work related to using voices or speech synthesis when the sim bogs down in the above capture. A SpeechSynthesisUtterance isn't created until we request speech.

jessegreenberg commented 3 years ago

Im actually able to produce this to some extent now with macOS 11.4 Chrome, with the Samantha voice.

Nancy-Salpepi commented 3 years ago

Really? I just tried on my MacBook Air (os 11.4 + chrome) and it worked perfectly. What other settings did you change?

jessegreenberg commented 3 years ago

It isn't nearly as severe as what is in your video capture. EDIT: It is pretty noticeable for me. I also cannot get it to happen as much with the arm. But every time it tries to speak there is a short delay. It happens more often when moving the leg for me for that reason.

Setings are just Voicing enabled with "Samantha" voice in Chrome.

jessegreenberg commented 3 years ago

Here is renderer summary without voicing/performance loss image

Render summary while using voicin: image

Noticeably more time spent in "Scripting" and "System".

jessegreenberg commented 3 years ago

Nothing in the call tree or "bottom up" view related to Voicing code. image

And the "Activity" elements listed when performance is good looks almost the same as the above image.

jessegreenberg commented 3 years ago

I did some google searching trying to find info about slow voices using speech synthesis, but nothing really came up. I think we are ready to close this issue as wontfix. Thanks for reporting @Nancy-Salpepi, sorry we aren't able to resolve this.

jessegreenberg commented 3 years ago

Note made in https://github.com/phetsims/qa/blob/master/documentation/accessibility-bugs.md#3-voicing. Closing