Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Removes extra parameter, changes async GCS test to use raw.
  • Loading branch information
gguuss committed Apr 5, 2017
commit deca26123de0423671203381d489073cd71bb4bd
2 changes: 1 addition & 1 deletion speech/cloud-client/transcribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def transcribe_gcs(gcs_uri):
encoding='FLAC',
sample_rate_hertz=16000)

alternatives = audio_sample.recognize(audio_sample, 'en-US')
alternatives = audio_sample.recognize('en-US')
for alternative in alternatives:
print('Transcript: {}'.format(alternative.transcript))

Expand Down
8 changes: 4 additions & 4 deletions speech/cloud-client/transcribe_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

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
"""

import argparse
Expand All @@ -40,7 +40,7 @@ def transcribe_file(speech_file):
encoding='LINEAR16',
sample_rate_hertz=16000)

operation = audio_sample.long_running_recognize(audio_sample, 'en-US')
operation = audio_sample.long_running_recognize('en-US')

retry_count = 100
while retry_count > 0 and not operation.complete:
Expand All @@ -67,10 +67,10 @@ def transcribe_gcs(gcs_uri):
audio_sample = speech_client.sample(
content=None,
source_uri=gcs_uri,
encoding='FLAC',
encoding='LINEAR16',
sample_rate_hertz=16000)

operation = audio_sample.long_running_recognize(audio_sample, 'en-US')
operation = audio_sample.long_running_recognize('en-US')

retry_count = 100
while retry_count > 0 and not operation.complete:
Expand Down
2 changes: 1 addition & 1 deletion speech/cloud-client/transcribe_async_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def test_transcribe(resource, capsys):

def test_transcribe_gcs(resource, capsys):
transcribe_async.transcribe_gcs(
'gs://python-docs-samples-tests/speech/audio.flac')
'gs://python-docs-samples-tests/speech/audio.raw')
out, err = capsys.readouterr()

assert re.search(r'how old is the Brooklyn Bridge', out, re.DOTALL | re.I)
2 changes: 1 addition & 1 deletion speech/cloud-client/transcribe_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def test_transcribe_file(resource, capsys):

def test_transcribe_gcs(resource, capsys):
transcribe.transcribe_gcs(
'gs://python-docs-samples-tests/speech/audio.flac')
'gs://python-docs-samples-tests/speech/audio.raw')
out, err = capsys.readouterr()

assert re.search(r'how old is the Brooklyn Bridge', out, re.DOTALL | re.I)