Created
October 6, 2012 00:33
-
-
Save kentbye/3843248 to your computer and use it in GitHub Desktop.
Text-to-MP3 Bash script using Mac's say command
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
FULLFILE=$1; | |
FILE="${FULLFILE%%.*}"; | |
# Convert to an audio file at 310 words per minute. I personally select the UK's Serena as the Mac default voice | |
echo "converting $FILE.txt to $FILE.aiff"; | |
`say -f $FILE.txt -r 310 -o $FILE.aiff --progress`; | |
echo "conververting $FILE.aiff to $FILE.mp3"; | |
`ffmpeg -i $FILE.aiff $FILE.mp3`; | |
# Change the MP3 ID3 for the Album | |
id3tag -A$FILE $FILE.mp3; | |
`rm $FILE.aiff`; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment