You are not logged in.
According to this page from 2018
https://www.ubuntubuzz.com/2018/12/text … peech.html
you need to install few things first.
Offline
Hi brontosaurusrex,
I did find the packages in synaptic and installed according to that page. It was all clear and simple and it worked:THANK YOU for your valuable help. I hope the voice will be more updated later to look like a real human's...
Offline
There are some additional voices, but not sure if any is better than default
apt-cache search mbrola-
sudo apt install mbrola mbrola-us2
espeak -v mb-us2 -p 70 -s 120 "everything has transpired according to my design."
Last edited by brontosaurusrex (2021-05-16 16:14:08)
Offline
Thanks to @bronto I spent 1/2 hour playing with espeak voices and ended up agreeing none of them seemed particularly better than default, at least for understandability. Back to espeak default.
Then spent another good half hour or more searching for other options...
https://elinux.org/RPi_Text_to_Speech_( … Synthesis)
https://circuitdigest.com/microcontroll … nd-pyttsx3
https://askubuntu.com/questions/53896/n … -to-speech
https://linuxreviews.org/Text_to_Speech … s_software
Installed and ran festival but was under-impressed.
Mimic's sound snippet sounded good but it needs to be compiled for Debian. Later...
Pico2wave actually sounds better than espeak, and is on Debian, but
1) It only supports English.
2) It needs a tricky workaround to output directly as speech, not to a file.
Even so, some people might find it worth checking:
sudo apt-get install libttspico-utils
ln -s /dev/stdout ~/pico.wav # choose a better location
pico2wave --wave=~/pico.wav "everything has Transpired according to my design." | aplay
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Online
I spent 1/2 hour playing with espeak voices and ended up agreeing none of them seemed particularly better than default, at least for understandability.
flite is better. Not as good as backed-by-AI-fed-by-billions-of-users-data, but better than espeak for sure.
A quick test with the default voices, it seems to be roughly on par with festival. But a lot depends on the chosen voice.
Offline
^Just installed and ran flite. To me (with the default voice) it sounded a bit gravelly, a lot like festival and only marginally better than espeak.
I do recommend giving pico2wave a try - it sounds smoother than any of the above, IMO.
EDIT I am getting an annoying click at the end of messages though, and it might sound a bit "muffled".
EDIT2 I hereby withdraw my recommendation of pico2wave. Once I tried @bronto's recommendation of '-voice slt' with flite it sounded much better.
There's no mention of '-voice' in 'man flite'', or of '-lv' to list the installed voices.
And downloading the alternative .festvox voices from http://www.festvox.org/flite/packed/flite-2.0/voices/ was a 550MB waste of time. Tried them all, and slt was still the best IMO.
Last edited by johnraff (2021-05-19 05:17:32)
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Online
Flite is fast (I use it in scripts that run long time), but mostly it has a very short text to read
flite -voice slt -t "Done."
or in the radio script to announce the array id
flite -voice slt -t "$id" &> /dev/null &
Last edited by brontosaurusrex (2021-05-18 09:05:37)
Offline
thank you @ohnonot flite sounds better and if I add punctuation it is less fast and clearer...thanks to all who participated in helping me out...I used the flite terminal command from you brontosaurusrex...but if i go to okular and click speak text now nothing happens..maybe it has to do with the flite installation packages from synaptic...
Offline
I got it back I did a reinstall because I had this error
E: Internal Error, No file name for speechd-up:amd64
so I removed the entire pkg and reinstalled back however I didn't think it was going to work as the installation black screen kept going back and forth for a long time...
Is there a way to integrate flite voices into okular or just by terminal...
Offline
What is the amount of integration with okular? Does it show word by word or line by line what is reading?
Is there any advanced logic to only read 'what it matters'?
(I'd have to test that before giving any meaningful answer.)
Other than that, funny stuff happens with
pdftotext test.pdf - | flite -voice slt
(pdftotext is part of calibre)
Text to lossy audio
flite -voice slt -t "Chuck Norris does not sleep. He waits." -o /dev/stdout | opusenc - - > chuck.opus
A lot of Chuck jokes
curl https://raw.githubusercontent.com/brontosaurusrex/stretchbang/master/.experiments/jokes/chuck-norris-jokes.txt | shuf | flite -voice http://festvox.org/flite/packed/flite-2.1/voices/cmu_us_aew.flitevox
Last edited by brontosaurusrex (2021-05-19 17:46:30)
Offline
@brontosaurusrex just instead of having the default voice, you can choose flite voice within okular, that's all
Thanks for the jokes some are really hilarious...(but don't tell chuck I said that)
Offline
I'am thinking a more general 'solution' could be made, for example this should read clipboard, so ctrl+c in okular and then
xclip -selection clipboard -o - && xclip -selection clipboard -o - | flite -voice slt
# And you could turn that into alias/script/button.
However I can't make it to work every time, it stops reading when it feels like (presumably confused with some special chars).
Illustration on how this could work
edit: And a little script for the same purpose, trying to avoid flite getting quiet, also brings line by line reading (reflowing at punctuations), it would need some more work, but should be usable right now.
https://raw.githubusercontent.com/bront … in/youread
edit2: Added google text to speech option (via gtts) that actually almost sounds like a real voice, but this is now moving things into cloud, so beware of any possible privacy implications before installing/enabling it. p.s. engine="flite" is completely offline.
Last edited by brontosaurusrex (2021-05-21 21:19:35)
Offline
yes a more general solution is better, the unix system also uses a more general tab in the settings under speech & dictation and from there also you can choose the voice and the language but that's just for talking as for the work it needs...I don't know how to estimate the brain-sweat for that operation...
thank you for your hard work...
Offline
And the year is now 2024, playing with Piper and getting some nice results.
github: https://github.com/rhasspy/piper, https://rhasspy.github.io/piper-samples/
Notes & example: https://brontosaurusrex.github.io/2024/ … ne-voices/
Offline
^Thanks, that sounds much more natural than espeak-ng, though I do also kind of enjoy the robot sound when getting system messages from the computer...
I piped the wav output straight to aplay instead of via a file, and prefer to pass the text directly as an argument instead of echoing it through a pipe, so if $pdir is where the downloaded piper executable lives (along with all the espeak and other stuff it came with), and you put the voice files in $pdir/voices, I use a small script like this:
pdir="$HOME"/Downloads/executables/piper/
voice=en_GB-alan-medium.onnx
"$pdir"/piper <<<"$*" --quiet --model "$pdir"/voices/"$voice" --output_file - | aplay > /dev/null 2>&1
I'll switch my "say" command to this for a while and see if I prefer it to espeak-ng or not.
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Online
^ Nice, if you do test on some longer texts (English voices), do let me know which ones are 'worthy' please (I plan to compare this to aws polly at some point in time).
Offline
^Yeah, well I'm afraid that won't be high on my todo list for a while. I only use the voice for a bit of feedback from scripts that might be running while I'm doing something else. All short snippets, no long texts.
The GB alan voice is fun, though the first invocation takes longer than espeak to come up. Once it's loaded in memory it's fast enough though. I haven't tried any of the other voices.
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Online
en_GB-semaine-medium = funny/nice (seems to be a winner so far, maybe with Alan and Joe together on the 2nd place). Also slowing it down a bit seems to 'help' a little towards understanding.
--length_scale 1.3
Note: Semaine has mutiple (4) voices.
Offline
^thanks I'll check those out. Alan's announcements are freaking me out - they're so realistic they're creepy.
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Online