kripken / speak.js

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

phoneme input/output #16

Open forresto opened 12 years ago

forresto commented 12 years ago

Now that I have been playing with it for a bit it would be fun to get the phonemes with -x to see how the input is getting parsed.

[[D,Is Iz sVm f@n'EtIk t'Ekst 'InpUt]] as input already works, and it is fun to hack with the phonemes.

kripken commented 12 years ago

Is -x something that espeak recognizes? How does it work?

forresto commented 12 years ago

I'm guessing that -x -q outputs something like [[D,Is Iz sVm f@n'EtIk t'Ekst 'InpUt]] which you could then alter and reinput with -w.

http://espeak.sourceforge.net/commands.html

-q Quiet. No sound is generated. This may be useful with options such as -x and --pho.

-w Writes the speech output to a file in WAV format, rather than speaking it.

-x The phoneme mnemonics, into which the input text is translated, are written to stdout.

-X As -x, but in addition, details are shown of the pronunciation rule and dictionary list lookup. This can be useful to see why a certain pronunciation is being produced. Each matching pronunciation rule is listed, together with its score, the highest scoring rule being used in the translation. "Found:" indicates the word was found in the dictionary lookup list, and "Flags:" means the word was found with only properties and not a pronunciation. You can see when a word has been retranslated after removing a prefix or suffix.

kripken commented 12 years ago

Nice, we should definitely do this.

thomas-picchetti commented 3 years ago

Hi ! Did you do it in the end ? espeak -x -q works great for what I need, but it would be much cooler to do it in the browser ! there is also espeak --ipa which outputs international phonetic alphabet. I must admit I'm lost : don't understand emscripten, and i don't understand whether speak.js allows this already, or if there is an easy way to modify and rebuild it to get access to the phoneme representation, or if it is hopeless.