@@ -35,10 +35,16 @@ credentials for applications.
35
35
Install Dependencies
36
36
++++++++++++++++++++
37
37
38
+ #. Clone python-docs-samples and change directory to the sample directory you want to use.
39
+
40
+ .. code-block :: bash
41
+
42
+ $ git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git
43
+
38
44
#. Install `pip `_ and `virtualenv `_ if you do not already have them. You may want to refer to the `Python Development Environment Setup Guide `_ for Google Cloud Platform for instructions.
39
45
40
- .. _Python Development Environment Setup Guide :
41
- https://cloud.google.com/python/setup
46
+ .. _Python Development Environment Setup Guide :
47
+ https://cloud.google.com/python/setup
42
48
43
49
#. Create a virtualenv. Samples are compatible with Python 2.7 and 3.4+.
44
50
@@ -91,21 +97,22 @@ To run this sample:
91
97
$ python transcribe.py
92
98
93
99
usage: transcribe.py [-h] path
94
-
100
+
95
101
Google Cloud Speech API sample application using the REST API for batch
96
102
processing.
97
-
103
+
98
104
Example usage:
99
105
python transcribe.py resources/audio.raw
100
106
python transcribe.py gs://cloud-samples-tests/speech/brooklyn.flac
101
-
107
+
102
108
positional arguments:
103
109
path File or GCS path for audio file to be recognized
104
-
110
+
105
111
optional arguments:
106
112
-h, --help show this help message and exit
107
113
108
114
115
+
109
116
Transcribe async
110
117
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
111
118
@@ -122,21 +129,22 @@ To run this sample:
122
129
$ python transcribe_async.py
123
130
124
131
usage: transcribe_async.py [-h] path
125
-
132
+
126
133
Google Cloud Speech API sample application using the REST API for async
127
134
batch processing.
128
-
135
+
129
136
Example usage:
130
137
python transcribe_async.py resources/audio.raw
131
138
python transcribe_async.py gs://cloud-samples-tests/speech/vr.flac
132
-
139
+
133
140
positional arguments:
134
141
path File or GCS path for audio file to be recognized
135
-
142
+
136
143
optional arguments:
137
144
-h, --help show this help message and exit
138
145
139
146
147
+
140
148
Transcribe with word time offsets
141
149
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
142
150
@@ -153,20 +161,21 @@ To run this sample:
153
161
$ python transcribe_word_time_offsets.py
154
162
155
163
usage: transcribe_word_time_offsets.py [-h] path
156
-
164
+
157
165
Google Cloud Speech API sample that demonstrates word time offsets.
158
-
166
+
159
167
Example usage:
160
168
python transcribe_word_time_offsets.py resources/audio.raw
161
169
python transcribe_word_time_offsets.py gs://cloud-samples-tests/speech/vr.flac
162
-
170
+
163
171
positional arguments:
164
172
path File or GCS path for audio file to be recognized
165
-
173
+
166
174
optional arguments:
167
175
-h, --help show this help message and exit
168
176
169
177
178
+
170
179
Transcribe Streaming
171
180
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
172
181
@@ -183,24 +192,25 @@ To run this sample:
183
192
$ python transcribe_streaming.py
184
193
185
194
usage: transcribe_streaming.py [-h] stream
186
-
195
+
187
196
Google Cloud Speech API sample application using the streaming API.
188
-
197
+
189
198
Example usage:
190
199
python transcribe_streaming.py resources/audio.raw
191
-
200
+
192
201
positional arguments:
193
202
stream File to stream to the API
194
-
203
+
195
204
optional arguments:
196
205
-h, --help show this help message and exit
197
206
198
207
208
+
199
209
Beta Samples
200
210
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
201
211
202
212
.. image :: https://gstatic.com/cloudssh/images/open-btn.png
203
- :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/beta_snippets.py; speech/cloud-client/README.rst
213
+ :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/beta_snippets.py, speech/cloud-client/README.rst
204
214
205
215
206
216
@@ -212,24 +222,26 @@ To run this sample:
212
222
$ python beta_snippets.py
213
223
214
224
usage: beta_snippets.py [-h] command path
215
-
225
+
216
226
Google Cloud Speech API sample that demonstrates enhanced models
217
227
and recognition metadata.
218
-
228
+
219
229
Example usage:
220
230
python beta_snippets.py enhanced-model resources/commercial_mono.wav
221
231
python beta_snippets.py metadata resources/commercial_mono.wav
222
-
232
+ python beta_snippets.py punctuation resources/commercial_mono.wav
233
+
223
234
positional arguments:
224
235
command
225
236
path File for audio file to be recognized
226
-
237
+
227
238
optional arguments:
228
239
-h, --help show this help message and exit
229
240
230
241
231
242
232
243
244
+
233
245
The client library
234
246
-------------------------------------------------------------------------------
235
247
0 commit comments