From 4c7741d5f3a615ba56100555e107a5d717f26138 Mon Sep 17 00:00:00 2001 From: Evan Zacks Date: Mon, 12 Sep 2016 12:14:39 -0400 Subject: [PATCH] specify type on --sample_rate to prevent TypeError (#513) --- speech/grpc/transcribe.py | 2 +- speech/grpc/transcribe_async.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/speech/grpc/transcribe.py b/speech/grpc/transcribe.py index b519e29e8f6f..d877eba08c16 100644 --- a/speech/grpc/transcribe.py +++ b/speech/grpc/transcribe.py @@ -89,7 +89,7 @@ def _gcs_uri(text): '--encoding', default='FLAC', choices=[ 'LINEAR16', 'FLAC', 'MULAW', 'AMR', 'AMR_WB'], help='How the audio file is encoded. See {}#L67'.format(PROTO_URL)) - parser.add_argument('--sample_rate', default=16000) + parser.add_argument('--sample_rate', type=int, default=16000) args = parser.parse_args() main(args.input_uri, args.encoding, args.sample_rate) diff --git a/speech/grpc/transcribe_async.py b/speech/grpc/transcribe_async.py index dfe35660d624..0835ab892ca3 100644 --- a/speech/grpc/transcribe_async.py +++ b/speech/grpc/transcribe_async.py @@ -115,7 +115,7 @@ def _gcs_uri(text): help='How the audio file is encoded. See {}#L67'.format( 'https://github.com/googleapis/googleapis/blob/master/' 'google/cloud/speech/v1beta1/cloud_speech.proto')) - parser.add_argument('--sample_rate', default=16000) + parser.add_argument('--sample_rate', type=int, default=16000) args = parser.parse_args() main(args.input_uri, args.encoding, args.sample_rate)