Here are some resources for more information about topics covered in this lesson:
Recognizing Speech in Other Languages
So far in this course, we’ve been recognizing speech in English, which is the default language for each
.recognize_*() method of the SpeechRecognition package. However, it is absolutely possible to recognize speech in other languages, and it’s quite simple to accomplish.
To recognize speech in a different language, set the
language keyword argument of the
.recognize_*() method to a string corresponding to the desired language. Most of the methods accept a BCP-47 language tag, such as
'en-US' for American English or
'fr-FR' for French. For example, what you’ll see onscreen next recognizes French speech in an audio file.
To find out which language tags are supported by the API you’re using, you’ll need to consult the corresponding documentation. A list of language tags used by
.recognize_google() can be found in Google’s online documentation.
Become a Member to join the conversation.