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?
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.