From ad787ce3bfea2bbed193797363f2a887206e4918 Mon Sep 17 00:00:00 2001 From: Gus Class Date: Tue, 11 Apr 2017 15:30:10 -0700 Subject: [PATCH 1/3] Changes docs for async playback to point to LINEAR16 example --- speech/cloud-client/README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/speech/cloud-client/README.rst b/speech/cloud-client/README.rst index c0d970f273e..cd5892345a4 100644 --- a/speech/cloud-client/README.rst +++ b/speech/cloud-client/README.rst @@ -127,7 +127,7 @@ To run this sample: Example usage: python transcribe_async.py resources/audio.raw - python transcribe_async.py gs://cloud-samples-tests/speech/brooklyn.flac + python transcribe_async.py gs://cloud-samples-tests/speech/brooklyn.raw positional arguments: path File or GCS path for audio file to be recognized From 0f525e771d858f44a900914863fd40446884d759 Mon Sep 17 00:00:00 2001 From: Gus Class Date: Thu, 13 Apr 2017 15:36:48 -0700 Subject: [PATCH 2/3] Updates to client library with FLAC support. --- speech/cloud-client/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/speech/cloud-client/requirements.txt b/speech/cloud-client/requirements.txt index deb66fcac83..3e58ad573f8 100644 --- a/speech/cloud-client/requirements.txt +++ b/speech/cloud-client/requirements.txt @@ -1 +1 @@ -google-cloud-speech==0.25.0 +google-cloud-speech==0.25.1 From f52bafa7200d4844214adb93a6c0f9e08155e416 Mon Sep 17 00:00:00 2001 From: Gus Class Date: Thu, 13 Apr 2017 15:49:13 -0700 Subject: [PATCH 3/3] Changes async examples to flac and updates README --- speech/cloud-client/README.rst | 2 +- speech/cloud-client/transcribe_async.py | 4 ++-- speech/cloud-client/transcribe_async_test.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/speech/cloud-client/README.rst b/speech/cloud-client/README.rst index cd5892345a4..c0d970f273e 100644 --- a/speech/cloud-client/README.rst +++ b/speech/cloud-client/README.rst @@ -127,7 +127,7 @@ To run this sample: Example usage: python transcribe_async.py resources/audio.raw - python transcribe_async.py gs://cloud-samples-tests/speech/brooklyn.raw + python transcribe_async.py gs://cloud-samples-tests/speech/brooklyn.flac positional arguments: path File or GCS path for audio file to be recognized diff --git a/speech/cloud-client/transcribe_async.py b/speech/cloud-client/transcribe_async.py index 8457871b3d7..bbf67355308 100644 --- a/speech/cloud-client/transcribe_async.py +++ b/speech/cloud-client/transcribe_async.py @@ -19,7 +19,7 @@ Example usage: python transcribe_async.py resources/audio.raw - python transcribe_async.py gs://cloud-samples-tests/speech/brooklyn.raw + python transcribe_async.py gs://cloud-samples-tests/speech/brooklyn.flac """ import argparse @@ -67,7 +67,7 @@ def transcribe_gcs(gcs_uri): audio_sample = speech_client.sample( content=None, source_uri=gcs_uri, - encoding='LINEAR16', + encoding='FLAC', sample_rate_hertz=16000) operation = audio_sample.long_running_recognize('en-US') diff --git a/speech/cloud-client/transcribe_async_test.py b/speech/cloud-client/transcribe_async_test.py index 8d719753d12..7d66747eb44 100644 --- a/speech/cloud-client/transcribe_async_test.py +++ b/speech/cloud-client/transcribe_async_test.py @@ -29,7 +29,7 @@ def test_transcribe(capsys): def test_transcribe_gcs(capsys): transcribe_async.transcribe_gcs( - 'gs://python-docs-samples-tests/speech/audio.raw') + 'gs://python-docs-samples-tests/speech/audio.flac') out, err = capsys.readouterr() assert re.search(r'how old is the Brooklyn Bridge', out, re.DOTALL | re.I)