File tree Expand file tree Collapse file tree 3 files changed +31
-6
lines changed Expand file tree Collapse file tree 3 files changed +31
-6
lines changed Original file line number Diff line number Diff line change @@ -121,6 +121,11 @@ To run this sample:
121
121
[--sample_rate SAMPLE_RATE]
122
122
input_uri
123
123
124
+ Transcribes a FLAC audio file stored in Google Cloud Storage using GRPC.
125
+
126
+ Example usage:
127
+ python transcribe.py --encoding=FLAC --sample_rate=16000 gs://speech-demo/audio.flac
128
+
124
129
positional arguments:
125
130
input_uri
126
131
@@ -148,6 +153,12 @@ To run this sample:
148
153
[--sample_rate SAMPLE_RATE]
149
154
input_uri
150
155
156
+ Sample that transcribes a FLAC audio file stored in Google Cloud Storage,
157
+ using async GRPC.
158
+
159
+ Example usage:
160
+ python transcribe_async.py --encoding=FLAC --sample_rate=16000 gs://speech-demo/audio.flac
161
+
151
162
positional arguments:
152
163
input_uri
153
164
Original file line number Diff line number Diff line change 12
12
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
13
# See the License for the specific language governing permissions and
14
14
# limitations under the License.
15
- """Sample that transcribes a FLAC audio file stored in Google Cloud Storage,
16
- using GRPC."""
15
+ """Transcribes a FLAC audio file stored in Google Cloud Storage using GRPC.
16
+
17
+ Example usage:
18
+ python transcribe.py --encoding=FLAC --sample_rate=16000 \
19
+ gs://speech-demo/audio.flac
20
+ """
17
21
18
22
import argparse
19
23
@@ -80,7 +84,9 @@ def _gcs_uri(text):
80
84
PROTO_URL = ('https://github.com/googleapis/googleapis/blob/master/'
81
85
'google/cloud/speech/v1beta1/cloud_speech.proto' )
82
86
if __name__ == '__main__' :
83
- parser = argparse .ArgumentParser ()
87
+ parser = argparse .ArgumentParser (
88
+ description = __doc__ ,
89
+ formatter_class = argparse .RawDescriptionHelpFormatter )
84
90
parser .add_argument ('input_uri' , type = _gcs_uri )
85
91
parser .add_argument (
86
92
'--encoding' , default = 'LINEAR16' , choices = [
Original file line number Diff line number Diff line change 13
13
# See the License for the specific language governing permissions and
14
14
# limitations under the License.
15
15
16
- """Sample that transcribes a FLAC audio file stored in Google Cloud Storage,
17
- using async GRPC."""
16
+ """
17
+ Sample that transcribes a FLAC audio file stored in Google Cloud Storage,
18
+ using async GRPC.
19
+
20
+ Example usage:
21
+ python transcribe_async.py --encoding=FLAC --sample_rate=16000 \
22
+ gs://speech-demo/audio.flac
23
+ """
18
24
19
25
import argparse
20
26
import time
@@ -105,7 +111,9 @@ def _gcs_uri(text):
105
111
106
112
107
113
if __name__ == '__main__' :
108
- parser = argparse .ArgumentParser ()
114
+ parser = argparse .ArgumentParser (
115
+ description = __doc__ ,
116
+ formatter_class = argparse .RawDescriptionHelpFormatter )
109
117
parser .add_argument ('input_uri' , type = _gcs_uri )
110
118
parser .add_argument (
111
119
'--encoding' , default = 'LINEAR16' , choices = [
You can’t perform that action at this time.
0 commit comments