Comments (6)
WARNING WARNING: Multiple instances of Three.js being imported.
WARNING The 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.
funny enough, the audioListener.context.state is running, not suspended, it should be fine...
from amazon-sumerian-hosts.
Ditto - this also happens on BabylonJS. It fails to playback any host audio on iOS nor on Safari on Mac.
from amazon-sumerian-hosts.
I have the exact same issue isolated to Safari on Mac and iOS devices. I found it was related to Safari's AutoPlay policy settings. You can't ask the user to set Allow All AutoPlay
of course, but it did help me find a partial solution in older posts like this.
In my three.js project, just using simple javascript, I created a a function attached to the click/tap event handler on a button the user clicks/taps before requesting audio from the host. Future requests for the AWS host to speak, were allowed.
function playMessage() {
const audio = new Audio("start.wav"); //this was just a silent audio file of 2 second duration.
const source = audioContext.createMediaElementSource(audio);
source.connect(audioContext.destination);
audio.play();
// Then the AWS host's speech plays on iOS and Mac Safari browser
const { name, host } = getCurrentHost(speakers); //speakers is a reference to the AWS host character
host.TextToSpeechFeature['play'](message); //message is a string - the text to send to the AWS host to speak.
}
My hopes were dashed after testing further. I noticed if the user delays between clicking and requesting more speech from the host, the audio starts to crackle and become distorted, as if Safari has detected you are pulling a fast one on it!
I post my partial findings in case this helps find a proper solution. This is a great open source project that is hampered with the Safari autoplay policy limitation I think. I hope the dev team on this can solve it better than I can.
from amazon-sumerian-hosts.
Hey @lbracegirdle @mikaelwozniak @ranilian @hyandell Did you find a solution for this? we can't get the audio to play on iOS in Chrome or Safari. We see in the Chrome console using chrome://inspect "the audio context is not running". We added a mute / play button to activate the audio context and replay the message, but still silence. Spent loads of time looking for an answer, so any suggestions would be much appreciated.
from amazon-sumerian-hosts.
Hey @crowers,
I did manage to fix the issue by changing the underlying method that audio is loaded which bypasses the iOS restriction. Note this is just my approach and is not an official answer. It may or may not work for you.
My fix is to change the streaming flag to false here:
from amazon-sumerian-hosts.
Hey @crowers,
I did manage to fix the issue by changing the underlying method that audio is loaded which bypasses the iOS restriction. Note this is just my approach and is not an official answer. It may or may not work for you. My fix is to change the streaming flag to false here:
.
Just wanted to update this issue: This quoted fix was working for over a year, but no longer works with the latest iOS. If anyone can find another way to auto play on iOS for Babylon.js, that would be extremely useful.
I created a start button that plays audio on click, but once it finishes and new audio is called once the first speech is completed, that new audio is mute.
from amazon-sumerian-hosts.
Related Issues (20)
- AWS-Infrastructure-Setup.md Documentation Is Very Obsolete HOT 1
- How did you create the libsync.glb file? HOT 1
- unable to get examples to work HOT 2
- Mouth Does Not Move With Speech HOT 7
- Add support for BabylonJS v5 HOT 13
- Speech animation, gaze tracking, face shape break with BabylonJS v5 HOT 1
- Custom Avatar Models for BabylonJS HOT 1
- LexRuntimeV2 recognizeUtterance Response HOT 2
- Cannot create and run "production" builds HOT 1
- Audio not working with BabylonJS Demo on iOS devices HOT 1
- Editing glTF assets with DCC Tools (import/export) degrades content. HOT 5
- How to develop a custom Amazon Sumerian Host avatar? HOT 9
- PlayCanvas host HOT 3
- Remove webpack, use vanilla ES Modules to simplify the project. HOT 2
- loading forever on mac HOT 3
- -
- replace Karma with @web/test-runner
- GET /_next/webpack-hmr 404 HOT 1
- Babylon types not visible
- Allow the usage of Generative Polly for a more natural sounding voice
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amazon-sumerian-hosts.