MAC's "say" command to MP3

22,696

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

Share:
22,696

Related videos on Youtube

Oussama L.
Author by

Oussama L.

Part time dev

Updated on July 17, 2022

Comments

  • Oussama L.
    Oussama L. almost 2 years

    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..

    • Carl Norum
      Carl Norum about 11 years
      Why can't you use txt2mp3mac in a shell script?
    • Oussama L.
      Oussama L. about 11 years
      there is no cli for this program!
    • Carl Norum
      Carl Norum about 11 years
      It appears to be an open-source applecsript app, it should be easy to modify, I'd think.
  • Mycah
    Mycah about 7 years
    Thanks! For Homebrew users that need Lame: brew install lame