commas in text for Flite app in asterisk stop speech
In Debian's Asterisk 13 with flite 2 TTS Small run-time speech synthesis engine with asterisk-flite package installed, commas, unless escaped or double quoted, seem to stop the speech. Perhaps all commas are interpreted as indicator of 2nd argument, as in: Flite(text[,intkeys])
; from extensions.conf
; for Flite you must double quote or escape commas
;this stops after longer because of the unescaped comma
exten => 1000,1,Flite('This is a sentence. This is a longer, more wordy sentence.')
exten => 1000,n,Hangup()
;double quotes seem to fix the problem, this whole phrase is spoken
exten => 1001,1,Flite("This is a sentence. This is a longer, more wordy sentence.")
exten => 1001,n,Hangup()
;backslash can escape the comma within single quotes
exten => 1002,1,Flite('This is a sentence. This is a longer\, more wordy sentence.')
exten => 1002,n,Hangup()
;backslash can escape the comma with no quotes quotes
exten => 1003,1,Flite(This is a sentence. This is a longer\, more wordy sentence.)
exten => 1003,n,Hangup()
;even a variable needs double quotes, or it stops at the comma
exten => 1004,1,Set(result=${SHELL(date -R)});
exten => 1004,2,Flite("${result}")
exten => 1004,n,Hangup()
also, the flite.config.sample should be copied into the /etc/asterisk directory as flite.conf
at the end of modules.conf this line was added:
load => app_flite.so
in console:
core show application Flite
-= Info about application 'Flite' =-
[Synopsis]
Say text to the user, using Flite TTS engine
[Description]
Flite(text[,intkeys]): This will invoke the Flite TTS engine, send a text string,
get back the resulting waveform and play it to the user, allowing any given interrupt
keys to immediately terminate and return the value, or 'any' to allow any number back.
[Syntax]
Not available
[Arguments]
Not available
[See Also]
Not available
-- linux macosx hints etc page