Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MAC's "say" command to MP3 [closed]

I want to read a very long text with the SAY mac's command (say -f file.txt), and to record the output to file.mp3. I thought about using ffmpeg to record all of it, but then i'll need to wait for all the reading process to complete..

I don't really need to listen to it, so if there is a way to directly have an mp3 file just by hitting enter, it would be great..

There is also this project txt2mp3mac but i can't use it in a shell script..

Thanks..

like image 508
Oussama L. Avatar asked May 11 '13 20:05

Oussama L.


People also ask

How do I play music through Terminal Mac?

Maybe you want to play a podcast from the command line on Mac? With the command line tool 'afplay' you can do just that, you can play practically any audio file format, whether it's M4A, AAC, MP3, WAV, AIFF, or whatever else is on your Mac, and you can start the audio right from the Terminal.

How do I open the Run command on a Mac?

In the Terminal app on your Mac, press the Up Arrow key. The last command you entered appears on the command line. Continue pressing the Up Arrow key until you see the command you want, then press Return.


1 Answers

I'm not on a Mac right now, so I can't test, but this page suggests you can do

say -f script.txt -o greetings.aiff 

to load what should be said from script.txt and save the audio output as greetings.aiff. You can then convert it to mp3 using lame with

lame -m m greetings.aiff greetings.mp3 

Definitely try the different voices. :D

like image 63
Anko Avatar answered Oct 16 '22 13:10

Anko