#!/usr/bin/env bash # # From CLI: # cat scripts/heat_test.py |sed 's/[^a-zA-Z .,!?]//g' | text2wave -o heattest.wav function helper(){ echo "SYNTAX: $0 text_file_to_convert" exit } if (( $# != 1 )) || [ ! -f $1 ]; then helper fi if [ -f output.wav ]; then echo "There is already an output.wav" echo "Closing" exit fi cat $1 | sed 's/[^a-zA-Z .,!?]//g' | text2wave -o output.wav echo "Would you like to convert to mp3? (y|n)" read ANS if (($ANS == 'y')); then echo "Output filename: " read FILENAME if [ -f $FILENAME ]; then echo "$FILENAME exists" exit fi lame --preset 160 output.wav $FILENAME rm output.wav exit fi echo "Your file is at output.wav"