Festival Speech Synthesis and Codec2

Here'a a bash script that takes as its first argument a string of quoted text. It then passes this through the festival text-to-sound processor and plays two versions of the result. The first version is unprocessed; the second version has been encoded with codec2 and then decoded.

The results are generally impressive. But I hope this might be some help in improving the codec. For instance, the roughening of sibilants like 'sss' in English (which becomes something like a 'sh' under codec2) is easily reproduced with festival.

To use this script, change the first line to point to the directory in which your c2enc file resides, save the script as, say, 'tts-codec2.sh' and then issue the command 'chmod a+x tts-codec2.sh' so that the script is executable. Then run it on the command line with 'tts-codec2.sh "Salmon steaks grill beautifully."' You'll hear the non-codec2 version, then the codec2 version.

CODEC2_HOME=/home/brucerob/Codec2/codec2/src
TFILEA="/tmp/$(basename $0).$$a.tmp"
TFILERAW="/tmp/$(basename $0).$$.raw"
echo $1 | text2wave | sox - -r 8000 -t raw -s -2 $TFILERAW 
play -r 8000 -t raw -s -2 $TFILERAW
$CODEC2_HOME/c2enc $TFILERAW $TFILEA
$CODEC2_HOME/c2dec $TFILEA $TFILERAW
du -sh $TFILEA
play -r 8000 -t raw -s -2 $TFILERAW

Comments

Popular posts from this blog

'Satpack' Arduino tracker PCB

Building the AA2TX Parasitic (Or 'Passive') Lindenblad for 70cm