Hi,
Following an interesting part in “Asterisk TFOT” book on setting Festival to work with Asterisk, I am trying to make Festival read from a text file rather than hardcoding the text to be spoken into the Festival () function.
So, instead of:
exten =>s,n,Festival(Hello from Festival)
I would like to pass the contents of a text file into Festival so that it will read them aloud:
Thank you baconbuttie,
So there’s no way of just passing an address to Festival, better use text2wave and then Playback() the resulting wav.
Looking at the code you provided, I am not sure what are you trying to do. Perhaps saving the value of the variable UNIQUEID in a text file and then read it via text2wave? If that is the case, why are you using text2wave to write to tony.txt? Again, I only guess the intention…
errr … that’s a working example. it reads the txt file, outputs it to the custom sounds directory with the uniqueid as part of the filename, then plays it before finally deleting it.