[this should be dealt with on ports@; cc'd and reply-to set] On 2011-06-11, Peter Fraser <p...@thinkage.ca> wrote to misc@: > I use Festival speech synthesis when I configure Asterisk and to debug my dial > plan. > > For day to day use I don't use Festival, and as a result I don't want the > Festival server > running all the time so I don't use the festival.conf within asterisk, but I > rather use > > macro sayText(text) { > sayTextfile = "/tmp/asterisk${RAND()}"; > System(echo "${text}"|/usr/local/bin/newtext2wave -otype ulaw >>${sayTextFile}.ulaw); > Playback(${sayTextFile}); > System(rm -f ${sayTextFile}.ulaw); > return; > } > > within the dial plan. > > The trouble is that text2wave gets a Segmentation fault.
So far I've only been able to repeat this problem by setting a non-default voice. I think the diff below should fix it. For people using extensions.conf rather than AEL who would like to use festival for TTS in this way, here's an example in that format..(asterisk is unnecessary to replicate the problem of course). [macro-sayText] exten => s,1,Set(sayTextFile=/tmp/${RAND()}) exten => s,n,System(echo ${ARG1}|/usr/local/bin/text2wave -otype ulaw > ${sayTextFile}.ulaw) exten => s,n,Playback(${sayTextFile}) exten => s,n,System(rm -f ${sayTextFile}.ulaw) and exten => blah,n,Macro(sayText,"this is a test") Index: Makefile =================================================================== RCS file: /cvs/ports/audio/festival/core/Makefile,v retrieving revision 1.18 diff -u -p -r1.18 Makefile --- Makefile 25 Apr 2011 15:01:28 -0000 1.18 +++ Makefile 12 Jun 2011 12:03:44 -0000 @@ -4,7 +4,7 @@ COMMENT= general multi-lingual speech sy V= 1.95 DISTNAME= festival-${V}-beta PKGNAME= ${DISTNAME:S/-beta/beta/} -REVISION= 4 +REVISION= 5 CATEGORIES= audio MASTER_SITES= http://www.cstr.ed.ac.uk/downloads/festival/${V}/ \ http://festvox.org/packed/festival/${V}/ Index: patches/patch-festival_examples_text2wave_sh =================================================================== RCS file: patches/patch-festival_examples_text2wave_sh diff -N patches/patch-festival_examples_text2wave_sh --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-festival_examples_text2wave_sh 12 Jun 2011 12:03:44 -0000 @@ -0,0 +1,16 @@ +$OpenBSD$ + +fixes occasional segfault/bus error in text2wave, especially using +alternative voices e.g. 'text2wave -eval "(voice_cmu_us_slt_arctic_hts)"' + +--- festival/examples/text2wave.sh.orig Sun Jun 12 13:00:45 2011 ++++ festival/examples/text2wave.sh Sun Jun 12 13:01:01 2011 +@@ -138,7 +138,7 @@ a single waveform at the end." + (define (combine_waves) + "Join all the waves together into the desired output file + and delete the intermediate ones." +- (let ((wholeutt (utt.synth (Utterance Text "")))) ++ (let ((wholeutt (Utterance Text ""))) + (mapcar + (lambda (d) + (utt.import.wave wholeutt d t)