0

I'm trying to write an app that will stream audio from the phone microphone to the google speech to text API and display it live on the device.

I get bits and pieces from here and there, but nothing that is allowing me to replicate the demos google provides on its "https://cloud.google.com/speech-to-text/" website.

Does anyone have experience streaming audio from Xamarin, and sending it to an API and receiving the response while still streaming the audio?

Wesley
  • 5,381
  • 9
  • 42
  • 65
  • 1
    You are looking for the "Cloud Speech RPC API" it is the streaming one. Google has an Android sample that can be "directly" ported to C#, that is what I did (https://cloud.google.com/speech-to-text/docs/samples / https://github.com/GoogleCloudPlatform/android-docs-samples/tree/master/speech/Speech) Note: the "streaming" API uses Google's `protobuf` as the over-the-wire data structure so you might have to start your learning there as to understand how that works so you can compile the "proto" files in their Android demos : https://developers.google.com/protocol-buffers/docs/csharptutorial – SushiHangover Sep 12 '18 at 18:07
  • @SushiHangover I get the concept, I have the sample up and running in Android Studio, but there are a lot of methods that don't translate properly. For example, the Xamarin AudioFormat object doesn't have a selector for PCM. I see it in an encoding item in the AudioRecord signature. Any chance you can post a sample of your port? – Wesley Sep 12 '18 at 22:32

0 Answers0