kripken / speak.js

Text-to-Speech in JavaScript using eSpeak
GNU General Public License v3.0
1.29k stars 293 forks source link

How to change the language and voice? #46

Open FE-Girl opened 9 years ago

FE-Girl commented 9 years ago

see the title

Luid101 commented 6 years ago

I am also working on this too, the voice sounds very robotic

Luid101 commented 6 years ago

There is some info on the page:

Language Support eSpeak supports multiple languages so speak.js can too. To do this, you need to build a custom version of speak.js:

Bundle the proper language files. For french, you need fr_dict and voices/fr. See commented-out code in emscripten.sh and bundle.py Expose those files to the emulated filesystem, in post.js. See commented-out code in there as well. Run emscripten.sh to build. You then need to call speak() with the voice option that tells it to use the right voice for your language. For example, for French this should work:

speak('boulanger', { voice: 'fr' })