say.js
say.js copied to clipboard
How to use festival with say.js?
Hi, I am developing a node application which will speak the user's input. User have the privilege to choose the voice as required from the given list. With the help of festival I got the list of voices. But how to use festival voices with say.js ? Sample code
const speak = (text = 'No text to read.') => {
return new Promise((resolve, reject) => {
let speed = 1;
let voice = "Alex"; //Need to change the voice as user input
say.speak(text, '', speed, (err) => {
if (err) {
reject(err);
}
console.log('Text has been spoken.');
resolve();
});
});
};
Thanks
You would set the voice
variable to the voice the user selected. Is that not working?
Hi @tlhunter setting the voice in say.speak() is not working.
Can you provide a list of installed Festival voices? What version of Festival are you using? Did you install any extra voices or just using whatever comes with a default Festival install?
I have used sudo apt-get install festival festvox-kallpc16k
. And the list of installed voices are listed bellow.
voice_czech_ph, voice_el_diphone, voice_hy_fi_mv_diphone, voice_msu_ru_nsh_clunits, voice_suo_fi_lj_diphone, voice_default, voice_gsw_450, voice_ked_diphone, voice_pc_diphone, voice_welsh_hl, voice_don_diphone, voice_gsw_diphone, voice_lp_diphone, voice_rab_diphone
Hi Guys,
I'm having trouble with this as well, it seems to work fine when I run it within festival or use:
echo "Hello world!" | festival --tts
But if I use say.js, there's no sound from my default device (in this case a USB speaker). I was absolutely pulling my hair out until I noticed when I ran that exact command with child_process, even though there was no sound, it seemed to wait for the duration of the text before the callback was fired.
I plugged in my headset to the 3.5mm jack and noticed the sound came out of there instead. So for me at least, it seems that child_process always uses the wrong device. Maybe the same thing is happening to you @bikram-choudhury
Anyone have an idea why the wrong audio device would be used with child_process? It's not just say.js either, I tested gnustep-gui-runtime's "say" command and it did the same thing. speech-dispatcher's spd-say just threw an error about not being able to connect to a unix socket.
Cheers, Chris.
I've been doing festival
research and there appears to be no sane method for getting a list of voices.
The previously mentioned approach (run festival
, type voice_
and press tab) doesn't really work.
Some documentation refers to a default-voice-priority-list
command which ran be run in the festival
REPL, but even the entries in that list do not work.
The only working voice I've been able to find is voice_kal_diphone
. Otherwise, any other voice will lead to some sort of error (though the text usually is spoken).