Skip to content

Commit

Permalink
Do not force LRO to be LINEAR16 only in Speech. (#3291)
Browse files Browse the repository at this point in the history
Fixes #3285
  • Loading branch information
lukesneeringer authored Apr 12, 2017
1 parent 90deef6 commit 6343af2
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
3 changes: 0 additions & 3 deletions packages/google-cloud-speech/google/cloud/speech/sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,6 @@ def long_running_recognize(self, language_code, max_alternatives=None,
:rtype: :class:`~google.cloud.speech.operation.Operation`
:returns: Operation for asynchronous request to Google Speech API.
"""
if self.encoding is not Encoding.LINEAR16:
raise ValueError('Only LINEAR16 encoding is supported by '
'long-running speech requests.')
api = self._client.speech_api
return api.long_running_recognize(
self, language_code, max_alternatives, profanity_filter,
Expand Down
11 changes: 0 additions & 11 deletions packages/google-cloud-speech/tests/unit/test_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,3 @@ def test_encoding(self):
source_uri=self.AUDIO_SOURCE_URI,
)
self.assertEqual(sample.encoding, Encoding.FLAC)

def test_async_linear16_only(self):
from google.cloud.speech.encoding import Encoding

sample = self._make_one(
encoding=Encoding.FLAC,
sample_rate_hertz=self.SAMPLE_RATE,
source_uri=self.AUDIO_SOURCE_URI,
)
with self.assertRaises(ValueError):
sample.long_running_recognize(language_code='en-US')

0 comments on commit 6343af2

Please sign in to comment.