Skip to content

Instantly share code, notes, and snippets.

@hdkmraf
Created January 13, 2017 15:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hdkmraf/43520735c18844e46280487741096cc5 to your computer and use it in GitHub Desktop.
Save hdkmraf/43520735c18844e46280487741096cc5 to your computer and use it in GitHub Desktop.
#!/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