Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 985c2be

Browse filesBrowse files
dizcologyJon Wayne Parrott
authored andcommitted
use region tags (GoogleCloudPlatform#1022)
1 parent 5d3b0b5 commit 985c2be
Copy full SHA for 985c2be

File tree

Expand file treeCollapse file tree

3 files changed

+10
-0
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+10
-0
lines changed

‎speech/cloud-client/transcribe.py

Copy file name to clipboardExpand all lines: speech/cloud-client/transcribe.py
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
# [END import_libraries]
2929

3030

31+
# [START def_transcribe_file]
3132
def transcribe_file(speech_file):
3233
"""Transcribe the given audio file."""
3334
from google.cloud import speech
@@ -55,8 +56,10 @@ def transcribe_file(speech_file):
5556
for alternative in alternatives:
5657
print('Transcript: {}'.format(alternative.transcript))
5758
# [END migration_sync_response]
59+
# [END def_transcribe_file]
5860

5961

62+
# [START def_transcribe_gcs]
6063
def transcribe_gcs(gcs_uri):
6164
"""Transcribes the audio file specified by the gcs_uri."""
6265
from google.cloud import speech
@@ -77,6 +80,7 @@ def transcribe_gcs(gcs_uri):
7780

7881
for alternative in alternatives:
7982
print('Transcript: {}'.format(alternative.transcript))
83+
# [END def_transcribe_gcs]
8084

8185

8286
if __name__ == '__main__':

‎speech/cloud-client/transcribe_async.py

Copy file name to clipboardExpand all lines: speech/cloud-client/transcribe_async.py
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import time
2828

2929

30+
# [START def_transcribe_file]
3031
def transcribe_file(speech_file):
3132
"""Transcribe the given audio file asynchronously."""
3233
from google.cloud import speech
@@ -63,8 +64,10 @@ def transcribe_file(speech_file):
6364
print('Transcript: {}'.format(alternative.transcript))
6465
print('Confidence: {}'.format(alternative.confidence))
6566
# [END migration_async_response]
67+
# [END def_transcribe_file]
6668

6769

70+
# [START def_transcribe_gcs]
6871
def transcribe_gcs(gcs_uri):
6972
"""Asynchronously transcribes the audio file specified by the gcs_uri."""
7073
from google.cloud import speech
@@ -93,6 +96,7 @@ def transcribe_gcs(gcs_uri):
9396
for alternative in alternatives:
9497
print('Transcript: {}'.format(alternative.transcript))
9598
print('Confidence: {}'.format(alternative.confidence))
99+
# [END def_transcribe_gcs]
96100

97101

98102
if __name__ == '__main__':

‎speech/cloud-client/transcribe_streaming.py

Copy file name to clipboardExpand all lines: speech/cloud-client/transcribe_streaming.py
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
# [END import_libraries]
2727

2828

29+
# [START def_transcribe_streaming]
2930
def transcribe_streaming(stream_file):
3031
"""Streams transcription of the given audio file."""
3132
from google.cloud import speech
@@ -62,6 +63,7 @@ def transcribe_streaming(stream_file):
6263
print('Confidence: {}'.format(alternative.confidence))
6364
print('Transcript: {}'.format(alternative.transcript))
6465
# [END migration_streaming_response]
66+
# [END def_transcribe_streaming]
6567

6668

6769
if __name__ == '__main__':

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.