Playing text to speech inside read function in asterisk

1.6k views Asked by At

So my basic aim is to take dtmf while the google text to speech agi is playing.In case of sound file i can simply use read function ,so the user is allowed to press dtmf while sound is been playing and the input is stored in a variable.For ex

[mycon]
exten => _X.,1,Read(KEY,soundfile,,)

But how can i take dtmf input while playing text to speech agi

Any help would be appreciated

1

There are 1 answers

0
arheops On BEST ANSWER

You have record TTS to wav file(8khz 16 bit mono pcm uncompressed format REQUIRED) and use something like this

[mycon]
exten => _X.,1,Read(KEY,soundfile&/tmp/tts/tts-file&other-sound,,)

You also can generate that file, save in variable and use that variable instead of file name.

Also you can use app_swift application which do that for you(for cepstral and some other TTS,not google). http://www.cepstral.com/en/telephony/asterisk

Third possible solution - write c/c++ app like app_swift for google or hire someone to write that.