|
| 1 | +# FAQ |
| 2 | + |
| 3 | +> Please read this carefully before opening a new issue. |
| 4 | +
|
| 5 | +## Overview |
| 6 | + |
| 7 | +<!-- START doctoc generated TOC please keep comment here to allow auto update --> |
| 8 | +<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> |
| 9 | + |
| 10 | +- [How can I use / install different voices?](#how-can-i-use--install-different-voices) |
| 11 | +- [Why does this library exists if I can use TTS natively in the browser?](#why-does-this-library-exists-if-i-can-use-tts-natively-in-the-browser) |
| 12 | +- [Why not using a cloud-based tts service?](#why-not-using-a-cloud-based-tts-service) |
| 13 | +- [Can I include service xyz with this library?](#can-i-include-service-xyz-with-this-library) |
| 14 | +- [Can I load my own / custom trained voices?](#can-i-load-my-own--custom-trained-voices) |
| 15 | +- [My or my users voices sound all terrible, what can I do?](#my-or-my-users-voices-sound-all-terrible-what-can-i-do) |
| 16 | +- [My voices play faster on a Mac M1 than on other machines](#my-voices-play-faster-on-a-mac-m1-than-on-other-machines) |
| 17 | +- [Init failed with "EasySpeech: browser has no voices (timeout)"](#init-failed-with-easyspeech-browser-has-no-voices-timeout) |
| 18 | +- [Error 'EasySpeech: not initialized. Run EasySpeech.init() first'](#error-easyspeech-not-initialized-run-easyspeechinit-first) |
| 19 | +- [Some specific voices are missing, although they are installed on OS-level](#some-specific-voices-are-missing-although-they-are-installed-on-os-level) |
| 20 | +- [My voices are gone or have changed after I updated my OS](#my-voices-are-gone-or-have-changed-after-i-updated-my-os) |
| 21 | +- [Error 'EasySpeech: text exceeds max length of 4096 bytes.'](#error-easyspeech-text-exceeds-max-length-of-4096-bytes) |
| 22 | +- [Safari plays speech delayed after interaction with other audio](#safari-plays-speech-delayed-after-interaction-with-other-audio) |
| 23 | + |
| 24 | +<!-- END doctoc generated TOC please keep comment here to allow auto update --> |
| 25 | + |
| 26 | +## How can I use / install different voices? |
| 27 | + |
| 28 | +> Note: the following cannot be influenced by this tool or JavaScript in general |
| 29 | +> and requires active measures by the user who wants to different/better voices. |
| 30 | +> This is by design and can only be changed if the Web Speech API standard improves. |
| 31 | +
|
| 32 | +- Browser-level: switch to Google Chrome as it delivers a set of Google Voices, which all sound pretty decent |
| 33 | +- OS-level: install new voices, which is an OS-specific procedure |
| 34 | + - [Windows](https://support.microsoft.com/en-us/topic/download-languages-and-voices-for-immersive-reader-read-mode-and-read-aloud-4c83a8d8-7486-42f7-8e46-2b0fdf753130) |
| 35 | + - [MacOS](https://support.apple.com/guide/mac-help/change-the-voice-your-mac-uses-to-speak-text-mchlp2290/mac) |
| 36 | + - [Ubuntu](https://github.com/espeak-ng/espeak-ng/blob/master/docs/mbrola.md#installation-of-standard-packages) |
| 37 | + - [Android](https://support.google.com/accessibility/android/answer/6006983?hl=en&sjid=9301509494880612166-EU) |
| 38 | + - [iOS](https://support.apple.com/en-us/HT202362) |
| 39 | + |
| 40 | +Please let me know if the guides are outdated or open a PR with updated links. |
| 41 | + |
| 42 | +## Why does this library exists if I can use TTS natively in the browser? |
| 43 | + |
| 44 | +Every browser vendor implements the [Web Speech API](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis) |
| 45 | +differently and there a multiple nuances that make it difficult to provide similar functionality across major browsers. |
| 46 | + |
| 47 | +## Why not using a cloud-based tts service? |
| 48 | + |
| 49 | +Sure you can do that. However, different projects have different requirements. |
| 50 | +If you can't afford a cloud-based service or are prohibited to do so then this |
| 51 | +tool might be something for you. |
| 52 | + |
| 53 | +## Can I include service xyz with this library? |
| 54 | + |
| 55 | +No, it's solely a wrapper for the [Web Speech API](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis) " |
| 56 | +standard". |
| 57 | + |
| 58 | +## Can I load my own / custom trained voices? |
| 59 | + |
| 60 | +Unfortunately, no. This is a current limitation of the Web Speech API itself |
| 61 | +and there is nothing we can do about it. |
| 62 | + |
| 63 | +If you want to this to become reality one day, you have to get in contact |
| 64 | +with browser vendors and the [Web Incubator Community Group](https://github.com/WICG/speech-api). |
| 65 | + |
| 66 | +## My or my users voices sound all terrible, what can I do? |
| 67 | + |
| 68 | +Sometimes this is the result of bad settings, like `pitch` and `rate`. |
| 69 | +Please check these value and try to run with explicit values of `1` for both of them. |
| 70 | + |
| 71 | +If this has no effect, then is not an issue of bad pitch/rate. It's very likely that the installed voices |
| 72 | +are simply bad / bad trained or old. |
| 73 | + |
| 74 | +Please read on ["How can I use / install different voices?"](#how-can-i-use--install-different-voices) |
| 75 | + |
| 76 | +## My voices play faster on a Mac M1 than on other machines |
| 77 | + |
| 78 | +This is unfortunately a vendor-specific issue and also supposedly a bug in Safari. |
| 79 | + |
| 80 | +Related issues: |
| 81 | +- https://github.com/jankapunkt/easy-speech/issues/116 |
| 82 | + |
| 83 | +## Init failed with "EasySpeech: browser has no voices (timeout)" |
| 84 | + |
| 85 | +This means your browser supports the minimum requirements for speech synthesis, |
| 86 | +but you / your users have no voices installed on your / their system. |
| 87 | + |
| 88 | +Please read on ["How can I use / install different voices?"](#how-can-i-use--install-different-voices) |
| 89 | + |
| 90 | +## Error 'EasySpeech: not initialized. Run EasySpeech.init() first' |
| 91 | + |
| 92 | +This means you haven't run `EasySpeech.init` yet. It's required to set up everything. |
| 93 | +See the [API Docs](./API.md) on how to use it. |
| 94 | + |
| 95 | +## Some specific voices are missing, although they are installed on OS-level |
| 96 | + |
| 97 | +This is something I found on newer iOS versions (16+) to be the case. |
| 98 | +While I have the Siri voice installed, it's not available in the browser. |
| 99 | +This seems to be a vendor-specific issue, so you need to contact your OS vendor (in this case Apple). |
| 100 | + |
| 101 | +## My voices are gone or have changed after I updated my OS |
| 102 | + |
| 103 | +This seems to be a vendor-specific issue, so you need to contact your operating system vendor (Apple, Microsoft). |
| 104 | + |
| 105 | +Related issues: |
| 106 | +- https://github.com/jankapunkt/easy-speech/issues/209 |
| 107 | + |
| 108 | +## Error 'EasySpeech: text exceeds max length of 4096 bytes.' |
| 109 | + |
| 110 | +Your text is too long for some voices to process it. You might want to split |
| 111 | +it into smaller chunks and play the next one either by user invocation or |
| 112 | +automatically. A small example: |
| 113 | + |
| 114 | +```js |
| 115 | +let index = 0 |
| 116 | +const text = [ |
| 117 | + 'This is the first sentence.', |
| 118 | + 'This is the second sentence.', |
| 119 | +] |
| 120 | + |
| 121 | + |
| 122 | +async function playToEnd () { |
| 123 | + const chunk = text[index++] |
| 124 | + if (!chunk) { return true } // done |
| 125 | + |
| 126 | + await EasySpeech.speak({ text: chunk }) |
| 127 | + return playToEnd() |
| 128 | +} |
| 129 | +``` |
| 130 | + |
| 131 | +Related issues: |
| 132 | +- https://github.com/jankapunkt/easy-speech/issues/227 |
| 133 | + |
| 134 | +## Safari plays speech delayed after interaction with other audio |
| 135 | + |
| 136 | +You can try to speak with `volume=0` before your actual voice is intended to speak. |
| 137 | + |
| 138 | +Related issues: |
| 139 | +- https://github.com/jankapunkt/easy-speech/issues/51 |
0 commit comments