Skip to content

Commit 4c7741d

Browse files
zacksejerjou
authored andcommitted
specify type on --sample_rate to prevent TypeError (#513)
1 parent e68aac1 commit 4c7741d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

speech/grpc/transcribe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def _gcs_uri(text):
8989
'--encoding', default='FLAC', choices=[
9090
'LINEAR16', 'FLAC', 'MULAW', 'AMR', 'AMR_WB'],
9191
help='How the audio file is encoded. See {}#L67'.format(PROTO_URL))
92-
parser.add_argument('--sample_rate', default=16000)
92+
parser.add_argument('--sample_rate', type=int, default=16000)
9393

9494
args = parser.parse_args()
9595
main(args.input_uri, args.encoding, args.sample_rate)

speech/grpc/transcribe_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def _gcs_uri(text):
115115
help='How the audio file is encoded. See {}#L67'.format(
116116
'https://github.com/googleapis/googleapis/blob/master/'
117117
'google/cloud/speech/v1beta1/cloud_speech.proto'))
118-
parser.add_argument('--sample_rate', default=16000)
118+
parser.add_argument('--sample_rate', type=int, default=16000)
119119

120120
args = parser.parse_args()
121121
main(args.input_uri, args.encoding, args.sample_rate)

0 commit comments

Comments
 (0)