Is it possible and advisable to call Google Cloud Speech APIs directly from browsers, including Safari?

Viewed 618

I am starting to explore Google Cloud Speech APIs.

I have read that

"Speech API supports any device that can send a REST request"

Therefore I am thinking that potentially I could call such APIs from any Browser (both on laptops and on mobile devices). Specifically I am interested in scenarios where the APIs are used to translate "voice" to text. I am figuring out something like the following:

  1. the user records his/her voice and stream it to the API
  2. the API transform it to text which is sent back to the browser
  3. the browser takes actions using the text received (e.g. saves the text on a back end DB)

I have searched a bit, collected some information, but I have some big areas of doubt which I would like to clear before actually moving along this path

  1. Is it possible and simple to call Google Cloud APIs directly from the browser, i.e. using Javascript? The doubt comes from the fact that the documentation shows nodejs examples but not pure javascript ones
  2. Can this scenario be implemented using Safari (both on desktop and on mobile)? The doubt comes from the fact that all the searches I have made so far point to pages where I read that Safari does not support Audio recording (i.e. the getUserMedia API of HTML5)

Any direction on these points will be very much appreciated.

1 Answers
Related