3333
3434def transcribe_file_with_enhanced_model ():
3535 """Transcribe the given audio file using an enhanced model."""
36- # [START speech_transcribe_file_with_enhanced_model ]
36+ # [START speech_transcribe_enhanced_model_beta ]
3737 from google .cloud import speech_v1p1beta1 as speech
3838 client = speech .SpeechClient ()
3939
@@ -60,12 +60,12 @@ def transcribe_file_with_enhanced_model():
6060 print ('-' * 20 )
6161 print ('First alternative of result {}' .format (i ))
6262 print ('Transcript: {}' .format (alternative .transcript ))
63- # [END speech_transcribe_file_with_enhanced_model ]
63+ # [END speech_transcribe_enhanced_model_beta ]
6464
6565
6666def transcribe_file_with_metadata ():
6767 """Send a request that includes recognition metadata."""
68- # [START speech_transcribe_file_with_metadata ]
68+ # [START speech_transcribe_recognition_metadata_beta ]
6969 from google .cloud import speech_v1p1beta1 as speech
7070 client = speech .SpeechClient ()
7171
@@ -105,12 +105,12 @@ def transcribe_file_with_metadata():
105105 print ('-' * 20 )
106106 print ('First alternative of result {}' .format (i ))
107107 print ('Transcript: {}' .format (alternative .transcript ))
108- # [END speech_transcribe_file_with_metadata ]
108+ # [END speech_transcribe_recognition_metadata_beta ]
109109
110110
111111def transcribe_file_with_auto_punctuation ():
112112 """Transcribe the given audio file with auto punctuation enabled."""
113- # [START speech_transcribe_file_with_auto_punctuation ]
113+ # [START speech_transcribe_auto_punctuation_beta ]
114114 from google .cloud import speech_v1p1beta1 as speech
115115 client = speech .SpeechClient ()
116116
@@ -134,12 +134,12 @@ def transcribe_file_with_auto_punctuation():
134134 print ('-' * 20 )
135135 print ('First alternative of result {}' .format (i ))
136136 print ('Transcript: {}' .format (alternative .transcript ))
137- # [END speech_transcribe_file_with_auto_punctuation ]
137+ # [END speech_transcribe_auto_punctuation_beta ]
138138
139139
140140def transcribe_file_with_diarization ():
141141 """Transcribe the given audio file synchronously with diarization."""
142- # [START speech_transcribe_diarization ]
142+ # [START speech_transcribe_diarization_beta ]
143143 from google .cloud import speech_v1p1beta1 as speech
144144 client = speech .SpeechClient ()
145145
@@ -172,13 +172,13 @@ def transcribe_file_with_diarization():
172172 for word_info in words_info :
173173 print ("word: '{}', speaker_tag: {}" .format (word_info .word ,
174174 word_info .speaker_tag ))
175- # [END speech_transcribe_diarization ]
175+ # [END speech_transcribe_diarization_beta ]
176176
177177
178178def transcribe_file_with_multichannel ():
179179 """Transcribe the given audio file synchronously with
180180 multi channel."""
181- # [START speech_transcribe_multichannel ]
181+ # [START speech_transcribe_multichannel_beta ]
182182 from google .cloud import speech_v1p1beta1 as speech
183183 client = speech .SpeechClient ()
184184
@@ -204,13 +204,13 @@ def transcribe_file_with_multichannel():
204204 print ('First alternative of result {}' .format (i ))
205205 print (u'Transcript: {}' .format (alternative .transcript ))
206206 print (u'Channel Tag: {}' .format (result .channel_tag ))
207- # [END speech_transcribe_multichannel ]
207+ # [END speech_transcribe_multichannel_beta ]
208208
209209
210210def transcribe_file_with_multilanguage ():
211211 """Transcribe the given audio file synchronously with
212212 multi language."""
213- # [START speech_transcribe_multilanguage ]
213+ # [START speech_transcribe_multilanguage_beta ]
214214 from google .cloud import speech_v1p1beta1 as speech
215215 client = speech .SpeechClient ()
216216
@@ -238,13 +238,13 @@ def transcribe_file_with_multilanguage():
238238 print ('-' * 20 )
239239 print ('First alternative of result {}: {}' .format (i , alternative ))
240240 print (u'Transcript: {}' .format (alternative .transcript ))
241- # [END speech_transcribe_multilanguage ]
241+ # [END speech_transcribe_multilanguage_beta ]
242242
243243
244244def transcribe_file_with_word_level_confidence ():
245245 """Transcribe the given audio file synchronously with
246246 word level confidence."""
247- # [START speech_transcribe_word_level_confidence ]
247+ # [START speech_transcribe_word_level_confidence_beta ]
248248 from google .cloud import speech_v1p1beta1 as speech
249249 client = speech .SpeechClient ()
250250
@@ -270,7 +270,7 @@ def transcribe_file_with_word_level_confidence():
270270 print (u'Transcript: {}' .format (alternative .transcript ))
271271 print (u'First Word and Confidence: ({}, {})' .format (
272272 alternative .words [0 ].word , alternative .words [0 ].confidence ))
273- # [END speech_transcribe_word_level_confidence ]
273+ # [END speech_transcribe_word_level_confidence_beta ]
274274
275275
276276if __name__ == '__main__' :
0 commit comments