I want to convert text in file a.txt to sound & play it using APLAY. any suggestions please?
Asked
Active
Viewed 1,304 times
3 Answers
1
You can use Festival.
text2wave myfile.txt | aplay
It is widely available in distributions and provides different voices.
Jakub Lucký
- 742
- 3
- 11
-
1Piping no longer works with text2wave [https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=861211] yet using festival its possible to do `festival --tts file.txt` – user174174 Mar 15 '19 at 08:35
1
espeak can read aloud in several languages. English is default, but you can use the option -v sv for Swedish and corresponding voices for other languages. See man espeak for more details. For example, change the speed, if you think espeak speaks too fast.
You can install espeak from the repository Universe,
sudo apt install espeak
and it can read from a string, a file or from standard input (you can pipe into it), for example
espeak 'Hello World'
espeak < /etc/hostname
date '+It is %H %M'| espeak
So it should work for you to run
espeak < a.txt
See also this link.
sudodus
- 6,071
- 14
- 27
0
flite : http://www.festvox.org/flite/
echo 'Hello world' | flite
Grzegorz Wierzowiecki
- 13,865
- 23
- 89
- 137