[Asterisk-java-users] Text-to-speech and gathering data (fastAGI)
Brought to you by:
srt
From: Darren H. <dha...@gh...> - 2006-02-27 19:20:42
|
Hey all, Continuing my mad plan for using asterisk-java & fastAGI...taking text, convert to voice, and then gathering data back. The below works, but there is a 3-sec delay for the conversion (which could be cached for future use, but focusing on the one-offs for now): =3D=3D=3D=3D=3D=3D[code]=3D=3D=3D=3D=3D String texttospeech =3D "Please enter your favorite number = between 10 and 100 followed by pound sign."; int soundhash =3D texttospeech.hashCode(); String sounddir =3D "/var/lib/asterisk/sounds/tts"; =20 String textfile =3D sounddir + "/ttsTEST-" + soundhash + ".txt"; String wavefile =3D sounddir + "/ttsTEST-" + soundhash + ".wav"; String gsmfile =3D sounddir + "/ttsTEST-" + soundhash + ".gsm"; result =3D exec("System","echo '" + texttospeech + "' > " + textfile); System.out.println("text save result: " + result); result =3D exec("System","text2wave -F 8000 -o " + wavefile + " " = + textfile); System.out.println("text2wave result: " + result); // result =3D exec("System","sox " + wavefile + " -r 8000 -c1 " + textfile); result =3D exec("System","sox " + wavefile + " " + gsmfile); System.out.println("sox result: " + result); =20 String captureddata =3D ""; captureddata =3D getData("tts/ttsTEST-" + soundhash); =3D=3D=3D=3D=3D[/code]=3D=3D=3D=3D=3D=3D Any recommendations to get this streamlined for one-off text conversions, or any pitfalls? TIA, -D |