Connect call from Asterisk to Google STT using PHPAGI

Hi am using PHPAGI I want to use the Google API below to convert live audio from Asterisk and return text.

Like if a user calls and gets to Asterisk, I want the call to be connected to the Google API below to do live recording and convert into text. Is this possible to connect a call from Asterisk to the API below using PHPAGI and I any guide on how to implement this?

If this is not possible what are other option like using JAVA with Google STT and AGI?

1 Like

Totally possible I done many times, just focus to get google API working, and then just pass the recorded audio to speech recognition script,

1 Like

Hi Johnbj,

Im using Zaf script and it works perfect. Also developing my own api. Feel free to contact me if u have any doubts:

1 Like

Hi, this is very suboptimal solution since your users will experience delays first for VAD to detect silence, then for Google to process speech. The delays could be several seconds. The zaf script also suffers from this design flow. And, moreover you have to pay for the Google.

The right solution would be to stream audio with EAGI/ARI/Asterisk speech module to python server probably and then you’ll get the results immediately.

You can check the following EAGI python code using Vosk server for example:

This code works with offline Vosk server and doesn’t require keys or internet connection, but it is also possible to set code with Google streaming API, I am just not aware of any examples of such setup.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.