Search code examples
javarestosgigoogle-speech-api

Google Speech API Live Recognition


We're working on an java application. I would use the Google Cloud Speech library but our application is based on osgi so i'd rather use the Google Cloud Speech Rest API. I'd like to know if it is possible to do some kind of livespeech recognition with this rest api. I am able to make single requests but i'd like to stream my audiodata and process the results over time.


Solution

  • From the Google Cloud Speech API Docs:

    Streaming speech recognition allows you to stream audio to Cloud Speech-to-Text and receive a stream speech recognition results in real time as the audio is processed. See also the audio limits for streaming speech recognition requests. Streaming speech recognition is available via gRPC only.

    If you want to use this API with OSGI you'll have to manipulate the Manifests by yourself. You'll probably run into some problems since grpc refers to SPI (ServiceLoader/Provider). I advise you to use Apache Aries SPI Fly when you have trouble with this services (http://aries.apache.org/modules/spi-fly.html),