Exercise

Different kinds of audio

Now you've seen an example of how the Recognizer class works. Let's try a few more. How about speech from a different language?

What do you think will happen when we call the recognize_google() function on a Japanese version of good_morning.wav (japanese_audio)?

The default language is "en-US", are the results the same with the "ja" tag?

How about non-speech audio? Like this leopard roaring (leopard_audio).

Or speech where the sounds may not be real words, such as a baby talking (charlie_audio)?

To familiarize more with the Recognizer class, we'll look at an example of each of these.

Instructions 1/4

undefined XP
  • 1

    Pass the Japanese version of good morning (japanese_audio) to recognize_google() using "en-US" as the language.

  • 2

    Pass the same Japanese audio (japanese_audio) using "ja" as the language parameter. Do you see a difference?

  • 3

    What about about non-speech audio? Pass leopard_audio to recognize_google() with show_all as True.

  • 4

    What if your speech files have non-audible human sounds? Pass charlie_audio to recognize_google() to find out.