o#!/bin/bash -f
#
# PODNAME: festivalogg
# ABSTRACT: script converting textfile named $1
#                               into oggfile $2
#                                 with voice $3
#           using festival

# Check arguments
if [ "$#" -ne 3 ]; then
    echo "Usage: $0 <input_text_file> <output_ogg_file> <voice>"
    exit 1
fi

# Settings
VOICE=${3:-us1_mbrola}          # check which voices exist using:
                                # $ festival
                                # festival> (voice.list)
                                # (quit)

# Start the feast!
text2wave -eval "(voice_$VOICE)" -o $2.wav $1
oggenc -o $2 $2.wav
/bin/rm $2.wav
