#!/bin/bash
# A small handy script to be able to read DOC files via festival
# In order to properly work this script requires
# working installation of the programs:
# antiword and festival
# This script is licensed under GNU GPL version 2
# Check out the license on http://gnu.org/licenses/gpl2.txt

# path to antiword and festival
antiword=$(which antiword)
festival=$(which festival);
arg1="$1";
new_name=$(echo $arg1 |sed -e "s#doc#txt#gi");
tmp_file="/tmp/$new_name";


if [ "$arg1" != "" ]; then
if [ "$antiword" ]; then
echo "Playing file $i";
$antiword "$arg1" | $festival --tts;
fi
else
echo "Missing [file] argument";
exit 1;
fi
