3
3
Google Cloud Speech API Python Samples
4
4
===============================================================================
5
5
6
+ .. image :: https://gstatic.com/cloudssh/images/open-btn.png
7
+ :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=speech/cloud-client/README.rst
8
+
9
+
6
10
This directory contains samples for Google Cloud Speech API. The `Google Cloud Speech API `_ enables easy integration of Google speech recognition technologies into developer applications. Send audio and receive a text transcription from the Cloud Speech API service.
7
11
8
12
- See the `migration guide `_ for information about migrating to Python client library v0.27.
@@ -58,6 +62,10 @@ Samples
58
62
Quickstart
59
63
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
60
64
65
+ .. image :: https://gstatic.com/cloudssh/images/open-btn.png
66
+ :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=speech/cloud-client/quickstart.py;speech/cloud-client/README.rst
67
+
68
+
61
69
62
70
63
71
To run this sample:
@@ -70,6 +78,10 @@ To run this sample:
70
78
Transcribe
71
79
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
72
80
81
+ .. image :: https://gstatic.com/cloudssh/images/open-btn.png
82
+ :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=speech/cloud-client/transcribe.py;speech/cloud-client/README.rst
83
+
84
+
73
85
74
86
75
87
To run this sample:
@@ -79,24 +91,29 @@ To run this sample:
79
91
$ python transcribe.py
80
92
81
93
usage: transcribe.py [-h] path
82
-
94
+
83
95
Google Cloud Speech API sample application using the REST API for batch
84
96
processing.
85
-
97
+
86
98
Example usage:
87
99
python transcribe.py resources/audio.raw
88
100
python transcribe.py gs://cloud-samples-tests/speech/brooklyn.flac
89
-
101
+
90
102
positional arguments:
91
103
path File or GCS path for audio file to be recognized
92
-
104
+
93
105
optional arguments:
94
106
-h, --help show this help message and exit
95
107
96
108
109
+
97
110
Transcribe async
98
111
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
99
112
113
+ .. image :: https://gstatic.com/cloudssh/images/open-btn.png
114
+ :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=speech/cloud-client/transcribe_async.py;speech/cloud-client/README.rst
115
+
116
+
100
117
101
118
102
119
To run this sample:
@@ -106,24 +123,29 @@ To run this sample:
106
123
$ python transcribe_async.py
107
124
108
125
usage: transcribe_async.py [-h] path
109
-
126
+
110
127
Google Cloud Speech API sample application using the REST API for async
111
128
batch processing.
112
-
129
+
113
130
Example usage:
114
131
python transcribe_async.py resources/audio.raw
115
132
python transcribe_async.py gs://cloud-samples-tests/speech/vr.flac
116
-
133
+
117
134
positional arguments:
118
135
path File or GCS path for audio file to be recognized
119
-
136
+
120
137
optional arguments:
121
138
-h, --help show this help message and exit
122
139
123
140
141
+
124
142
Transcribe with word time offsets
125
143
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
126
144
145
+ .. image :: https://gstatic.com/cloudssh/images/open-btn.png
146
+ :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=speech/cloud-client/transcribe_word_time_offsets.py;speech/cloud-client/README.rst
147
+
148
+
127
149
128
150
129
151
To run this sample:
@@ -133,23 +155,28 @@ To run this sample:
133
155
$ python transcribe_word_time_offsets.py
134
156
135
157
usage: transcribe_word_time_offsets.py [-h] path
136
-
158
+
137
159
Google Cloud Speech API sample that demonstrates word time offsets.
138
-
160
+
139
161
Example usage:
140
162
python transcribe_word_time_offsets.py resources/audio.raw
141
163
python transcribe_word_time_offsets.py gs://cloud-samples-tests/speech/vr.flac
142
-
164
+
143
165
positional arguments:
144
166
path File or GCS path for audio file to be recognized
145
-
167
+
146
168
optional arguments:
147
169
-h, --help show this help message and exit
148
170
149
171
172
+
150
173
Transcribe Streaming
151
174
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
152
175
176
+ .. image :: https://gstatic.com/cloudssh/images/open-btn.png
177
+ :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=speech/cloud-client/transcribe_streaming.py;speech/cloud-client/README.rst
178
+
179
+
153
180
154
181
155
182
To run this sample:
@@ -159,21 +186,22 @@ To run this sample:
159
186
$ python transcribe_streaming.py
160
187
161
188
usage: transcribe_streaming.py [-h] stream
162
-
189
+
163
190
Google Cloud Speech API sample application using the streaming API.
164
-
191
+
165
192
Example usage:
166
193
python transcribe_streaming.py resources/audio.raw
167
-
194
+
168
195
positional arguments:
169
196
stream File to stream to the API
170
-
197
+
171
198
optional arguments:
172
199
-h, --help show this help message and exit
173
200
174
201
175
202
176
203
204
+
177
205
The client library
178
206
-------------------------------------------------------------------------------
179
207
0 commit comments