I'm trying to connect my PBX IVR to Google Speech API using syncrecognize method, but since I need to record voice, send it to API, wait for response and process it back, is impossible to have a normal conversation or attempt to have a normal conversation/process voice using it for real time services. Is there any other API is recommended? or is there a way to setup VoIP/Streaming to Google. Similar like Alexa/Google Home. I didnt find anything for RecognitionAudio object:
Google Cloud Speech API service supports two different functions:
Both the above operations can be:
Streaming Recognition API is recomended for your application scenario, consider it is accessible only with Cloud Speech RPC API (google RPC), while Non Streaming Recognition API is available both with both Cloud Speech REST and RPC API.
We used AsyncStreamingRecognize in a similar application environment via gRPC API, the project was in C++, environment setup was quite long and complex (you need to download and build grpc, protoc and Google Speech API stubs/libraries for your environment). For the application we used as reference the examples available on Google Speech API Site, once the environment was ready it was quite simple to adapt the sample application logic to our specific scenario.
With streaming API you have limitations on audio encoding (not all encoding are supported) and the length of the audio processed (in streaming you can process up to 1 minute of speech), moreover, you can access the API only with a Service Account that must be enabled to use Speech API.