Skip to content

Latest commit

 

History

History
139 lines (94 loc) · 6.47 KB

FAQ.md

File metadata and controls

139 lines (94 loc) · 6.47 KB

FAQ

Please read this carefully before opening a new issue.

Overview

How can I use / install different voices?

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.

Why does this library exists if I can use TTS natively in the browser?

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.

Why not using a cloud-based tts service?

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.

Can I include service xyz with this library?

No, it's solely a wrapper for the Web Speech API " standard".

Can I load my own / custom trained voices?

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.

My or my users voices sound all terrible, what can I do?

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?"

My voices play faster on a Mac M1 than on other machines

This is unfortunately a vendor-specific issue and also supposedly a bug in Safari.

Related issues:

Init failed with "EasySpeech: browser has no voices (timeout)"

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?"

Error 'EasySpeech: not initialized. Run EasySpeech.init() first'

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.

Some specific voices are missing, although they are installed on OS-level

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).

My voices are gone or have changed after I updated my OS

This seems to be a vendor-specific issue, so you need to contact your operating system vendor (Apple, Microsoft).

Related issues:

Error 'EasySpeech: text exceeds max length of 4096 bytes.'

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:

Safari plays speech delayed after interaction with other audio

You can try to speak with volume=0 before your actual voice is intended to speak.

Related issues: