Closed charles-hay closed 2 years ago
@charles-hay Is this linked to this previously reported issue?
Yes it is. I was using it on MacOS so it wasn't causing it not to play it was just throwing a warning. I was also using Three.js so the streaming flag is not available. Thanks for pointing me in the right direction!
I'm having the same issue as two of my clients require this in three.js for its other features (so can't use the Babylon workaround). This has had me stuck for a while so really hope someone has an solution for three.js
This isn't an issue in the hosts, three.js or Babylon, this is enforced by the browser unfortunately. Making it worse, browsers enforce this differently and not always consistently. You will need to add a user interaction, such as a button press or other touch interaction, before audio starts to play. This is why many experiences begin with a "touch to begin"-type button to fulfill that requirement.
When loading the app from a static site generator(Github Pages) I get the warning message
The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://goo.gl/7K7WLu
on linethree.min.js:formatted:19644
andThe audio context is not running. Speech will not be able to be played until it is resumed. Use the "TextToSpeechFeature.resumeAudio" method to try to resume it after a user gesture.
on lineTextToSpeechFeature.js:26