Demo Code Deep Dive

Here, we pull apart the demo code to understand how to access the API and the results.

Imports

# [START speech_quickstart_beta]
from google.cloud import speech_v1p1beta1
from google.cloud.speech_v1p1beta1 import enums

The first line allows access to the speech API client, The second line brings in enums that are useful later in the code, such as enums.RecognitionConfig.AudioEncoding.MP3.

Create a free account to view this lesson.

By signing up, you agree to Educative's Terms of Service and Privacy Policy