brailcom / speechd

Common high-level interface to speech synthesis
GNU General Public License v2.0
231 stars 67 forks source link

flite should support listing voices #435

Open sthibaul opened 4 years ago

sthibaul commented 4 years ago

flite.c currently only calls register_cmu_us_kal16 or register_cmu_us_kal.

configure.ac should also try to detect libflite_cmu_us_awb, libflite_cmu_us_slt, libflite_cmu_indic_lang and lex, register their languages, and also look in /usr/share/flite for .flitevox files, to be listed as well in module_list_voices.

jtojnar commented 2 years ago

Since flite takes precedence over espeak-ng, Firefox thinks TTS is not present when it gets no voice.

According to flite docs, the list of voices should be available in flite_voice_list global variable but that seems to remain null, even if I check it after running flite_init and register_cmu_us_kal16. It looks like the value is only populated by flite_set_voice_list function in the C file generated by make_voice_list, whose object file is only linked to the binary, not the library.

I guess this is related to https://github.com/festvox/flite/issues/55.

sthibaul commented 2 years ago

Since flite takes precedence over espeak-ng

Does firefox not allow to change the speech module?

sthibaul commented 2 years ago

85310157b96632ff35749af630fcb1a4b33bbac2 and 65b76299fddf6c26930cbfd2ecefd14d47a70e46 should be helping with the situation.

jtojnar commented 2 years ago

Does firefox not allow to change the speech module?

Not that I am aware of. It just seems to call spd_list_synthesis_voices:

https://salsa.debian.org/mozilla-team/firefox/-/blob/debian/95.0.1-1/dom/media/webspeech/synth/speechd/SpeechDispatcherService.cpp#L355

sthibaul commented 2 years ago

Ok, then I'll release a 0.11.1 shortly, after you confirm that the commits above fix the issue

jtojnar commented 2 years ago

Can confirm that 65b76299fddf6c26930cbfd2ecefd14d47a70e46 makes Firefox TTS work:

Popup controlling Narrate feature in Reader mode in Firefox