Closed ramnath-1998 closed 3 years ago
You need to specify a command in the preferences.
If you have espeak-ng
installed, you can use espeak-ng
as the command.
For Festival, the command is festival --tts
.
You can choose different voices or languages, as well as other options, by changing the command. Run man espeak-ng
or man festival
in the terminal to see detailed instructions on how to configure these programs.
From the wiki:
How to use text-to-speech?
Foliate supports
espeak
/espeak-ng
andfestival
. The exact command can be configured in the preference dialog.Other speech synthesis programs can be used, but Foliate expects the following interface:
- The program would read text from
stdin
and speak them- Return when finished speaking
- Stop speaking when
SIGINT
is receivedIf the program doesn't support this, one can write a wrapper script and set it as the TTS command. For example, to use gTTS, the following script can be used:
#!/bin/bash gtts-cli --file /dev/stdin | play -t mp3 - & trap 'kill $!; exit 0' INT wait
@ramnath-1998 For Debian based systems I suggest using festival
.
festival
(TTS engine) and some festvox-*
packages(other voices, the default voices are unbearable). .festivalrc
and set a default voice with (set! voice_default voice_name)
. For example, I want to use festival
with 'en1_mbrola' voice. I will type in Terminal:
sudo apt install festival festvox-en1
echo "(set! voice_default en1_mbrola)" >> .festivalrc
Then type: festival --tts
in Foliate-->preferences-->Text-to-speech command.
Happy reading :smile:
I tried. But its not working.
On Thu, May 14, 2020 at 11:56 AM Blanc Chan notifications@github.com wrote:
@ramnath-1998 https://github.com/ramnath-1998 For Debian based systems I suggest using festival.
- You need to install festival(TTS engine) and some festvox-* packages(other voices, the default voices are unbearable).
- Then go to your home and create a .festivalrc and set a default voice with (set! voice_default voice_name).
- And you need to type your TTS command in Foliate's preferences. Once you typed, a headphone icon will appear in the bottom bar. Click to start TTS.
For example, I want to use festival with 'en1_mbrola' voice. I will type in Terminal:
sudo apt install festival festvox-en1
echo "(set! voice_default en1_mbrola)" >> .festivalrc
Then type: festival --tts in Foliate-->preferences-->Text-to-speech command.
Happy reading 😄
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/johnfactotum/foliate/issues/354#issuecomment-628416295, or unsubscribe https://github.com/notifications/unsubscribe-auth/APSILV2XNK6YBV3TRKIUR5LRROFIPANCNFSM4NAARH4A .
@ramnath-1998 can you provide more detailed information? Such as your OS type, what tts engine you installed? and if possible, any terminal info or screenshot?
Make sure gtts-cli and sox are installed:
gtts-cli --version
sox --version
Try again with bash -c
, Preferences -> Text-to-speech command:
bash -c "gtts-cli -l $FOLIATE_TTS_LANG_LOWER --file /dev/stdin | play -t mp3 - &
trap 'kill $!; exit 0' INT
wait"
Closing due to inactivity. Feel free to comment if you have any further questions.
can you explain how to enable the TTS feature using any of the tools that are available, in detail.