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)