I’m using the Asterisk External Application Protocol with the Speech to Text Engine. Here’s my current dialplan:
exten = 1,1,Answer
same = n,Wait(1)
same = n,SpeechCreate
same = n,SpeechBackground(my_audio,30)
Currently, the SpeechBackground application plays ‘my_audio,’ and when I start speaking, ‘my_audio’ continues to play without stopping to wait for me to finish. How can I make SpeechBackground stop ‘my_audio’ when I begin any response (speaking or pressing a key)? This behavior is similar to the Read application, which stops playing audio when I press the first key and waits for me to finish.
exten => 550,1,NoOp()
same => n,Answer()
same => n,SpeechCreate(my-speech-to-text)
same => n,SpeechStart()
same => n,SpeechBackground(hello-world)
same => n,Verbose(0,${SPEECH_TEXT(0)})
same => n,SpeechDestroy()
same => n,Hangup()
I believe he just shorten it to post question. I work with him so yeah…Anyway… I tried it with PHP AGI but when user speak the SpeechBackground doesn’t stop. I don’t know if my aeap is not correctly config or that the application is not working as like it get written in the docs.
exten => 1,1,Answer
same => n,SpeechCreate(my-speech-to-text)
same => n,SpeechStart()
same => n,SpeechBackground(my_audio,30)
same => n,SpeechDestroy()
same => n,Hangup()
How can I make SpeechBackground stop ‘my_audio’ when I begin any response (speaking)?
Im try use BackgroundDetect, but this not work because I can’t get full response
It’s up to the res_speech_aeap module, and it doesn’t appear as though it has been implemented as of yet. It is responsible for setting a flag to indicate playback should stop when they start talking.
There’s noone actively working on it. How to set flags is standard in Asterisk code generally, and the module which reacts is res_speech.c, there’s also a silence detector API which could be used. You would have to piece it all together in the code though.
Like I said though, it’s up to you to piece it all together. I’m not going to tell you how to do that, because that’s the equivalent of asking someone else to do the work for you and it’s not a project I’m doing.