5

Is there an option to automatically detect the spoken language using Google Cloud Platform Machine Learning's Speech API?

https://cloud.google.com/speech/docs/languages indicates the list of the languages supported. However, the user needs to manually set this parameter to perform speech-to-text. I'd like to do this automatically.

Cyril Graze
  • 3,881
  • 2
  • 21
  • 27
Jon Stark
  • 215
  • 2
  • 17
  • it is working in google translate app, when we do voice translation it listens to both the languages and does the translation between the two whichever was spoken, how can i implement the same thing in my app, right now my app does translation between input and output language but cannot perform vice versa at the same time – Jon Stark Jul 04 '17 at 09:58
  • Hi, did you manage to solve this problem? – JLT Jun 11 '18 at 02:22
  • @finalstatic have posted an answer you can go through it if it can help you – Jon Stark Jun 11 '18 at 07:12
  • Thanks for sharing! :) – JLT Jun 11 '18 at 11:44
  • 2
    Does this answer your question? [how to detect language spoken in google cloud platform machine learning speech api](https://stackoverflow.com/questions/44129195/how-to-detect-language-spoken-in-google-cloud-platform-machine-learning-speech-a) – bain Nov 11 '20 at 18:12

3 Answers3

2

Google does not provide direct api for spoken language detection, So it can be implemented using the following steps, although its not 100% accurate:-

1.Use google speech api to convert voice to text.

2.send the spoken voice to api one by one with both the selected language codes.

3.In the response of api it give the value of confidence and number of alternatives.

4.compare the value of confidence of both the output and use the one with the greater value of confidence.

Although this is not the accurate way to do this but its just a simple work around if it can help anyone out.

Jon Stark
  • 215
  • 2
  • 17
1

No, I believe you (at least currently) have to specify the input language. (Unlike the Translation API where you can let it auto-detect, for example.)

Jon Skeet
  • 1,421,763
  • 867
  • 9,128
  • 9,194
  • ok thanks got it, but in google translate app when we choose two languages for voice translation then we can speak in either of the two languages it gets auto detected out of the two, how to implement that functionality – Jon Stark Jul 04 '17 at 09:19
  • @JonStark: I don't know whether that's possible with the current API. It may be feasible in the future, I don't know. – Jon Skeet Jul 04 '17 at 09:26
1

Now there is a beta release that helps, see chapter "Detecting language spoken automatically" in Google Speech API doc: https://cloud.google.com/speech-to-text/docs/multiple-languages

Giorgio Robino
  • 2,148
  • 6
  • 38
  • 59