Please read this carefully before opening a new issue.
- How can I use / install different voices?
- Why does this library exists if I can use TTS natively in the browser?
- Why not using a cloud-based tts service?
- Can I include service xyz with this library?
- Can I load my own / custom trained voices?
- My or my users voices sound all terrible, what can I do?
- My voices play faster on a Mac M1 than on other machines
- Init failed with "EasySpeech: browser has no voices (timeout)"
- Error 'EasySpeech: not initialized. Run EasySpeech.init() first'
- Some specific voices are missing, although they are installed on OS-level
- My voices are gone or have changed after I updated my OS
- Error 'EasySpeech: text exceeds max length of 4096 bytes.'
- Safari plays speech delayed after interaction with other audio
Note: the following cannot be influenced by this tool or JavaScript in general and requires active measures by the user who wants to different/better voices. This is by design and can only be changed if the Web Speech API standard improves.
- Browser-level: switch to Google Chrome as it delivers a set of Google Voices, which all sound pretty decent
- OS-level: install new voices, which is an OS-specific procedure
Please let me know if the guides are outdated or open a PR with updated links.
Every browser vendor implements the Web Speech API differently and there a multiple nuances that make it difficult to provide similar functionality across major browsers.
Sure you can do that. However, different projects have different requirements. If you can't afford a cloud-based service or are prohibited to do so then this tool might be something for you.
No, it's solely a wrapper for the Web Speech API " standard".
Unfortunately, no. This is a current limitation of the Web Speech API itself and there is nothing we can do about it.
If you want to this to become reality one day, you have to get in contact with browser vendors and the Web Incubator Community Group.
Sometimes this is the result of bad settings, like pitch
and rate
.
Please check these value and try to run with explicit values of 1
for both of them.
If this has no effect, then is not an issue of bad pitch/rate. It's very likely that the installed voices are simply bad / bad trained or old.
Please read on "How can I use / install different voices?"
This is unfortunately a vendor-specific issue and also supposedly a bug in Safari.
Related issues:
This means your browser supports the minimum requirements for speech synthesis, but you / your users have no voices installed on your / their system.
Please read on "How can I use / install different voices?"
This means you haven't run EasySpeech.init
yet. It's required to set up everything.
See the API Docs on how to use it.
This is something I found on newer iOS versions (16+) to be the case. While I have the Siri voice installed, it's not available in the browser. This seems to be a vendor-specific issue, so you need to contact your OS vendor (in this case Apple).
This seems to be a vendor-specific issue, so you need to contact your operating system vendor (Apple, Microsoft).
Related issues:
Your text is too long for some voices to process it. You might want to split it into smaller chunks and play the next one either by user invocation or automatically. A small example:
let index = 0
const text = [
'This is the first sentence.',
'This is the second sentence.',
]
async function playToEnd () {
const chunk = text[index++]
if (!chunk) { return true } // done
await EasySpeech.speak({ text: chunk })
return playToEnd()
}
Related issues:
You can try to speak with volume=0
before your actual voice is intended to speak.
Related issues: