So I worked on a quick one pager site (http://www.isthecloser.com) with a co-worker (Jason) from Tribal that merged two wav files to create a funny short wav clip.  Check it out.

To build the site, I used two technologies:

1) Flite – an open source text-to-speech system developed by CMU.  It was a low quality wav, but did the job well.  I also used Espeak, but the code looked like it required the server to a sound card installed, which mine does not.  So I switched over to flite instead.

2)  SOX – an open source sound exchange application.  I originally used the default one that came with CentOS 5, but it lacked the feature of sequencing the sounds together instead of merging them on top of each other.  So I uninstalled the default rpm and downloaded the code base and recompiled the latest version.

The code wasn’t too complicated, it was just figuring out how to get all the stuff to work together.  First get flite to spit out a wav:

/usr/local/bin/flite -t “‘ . $name . ‘” -o /tmp/closertemp/’ . $rand . ‘.wav’

the -t option is to use the text that’s passed in instead of a file

then I push it to sox:

/usr/local/bin/sox –combine concatenate /tmp/closertemp/’ . $rand . ‘.wav /tmp/TheCloser_1.wav /tmp/’ . $rand . ‘.wav’

the rand # is to make sure i always produce a unique file name for every request.