Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/bash
# Converts txt files to mp3, output goes into same directory as input
# Usage:
# ./text_to_mp3.sh input_file
# Requirements:
# say, ffmpeg
# $1 - filepath
echo "Input text $1"
say -f $1 -o "$1.aiff"
ffmpeg -i "$1.aiff" -f mp3 -acodec libmp3lame -ab 192000 -ar 44100 "$1.mp3"
rm "$1.aiff"
echo "Your file is ready as $1.mp3"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.