1

I want to convert text in file a.txt to sound & play it using APLAY. any suggestions please?

1

You can use Festival.

text2wave myfile.txt | aplay

It is widely available in distributions and provides different voices.

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.