Skip to content

Commit

Permalink
Do not force LRO to be LINEAR16 only in Speech. (googleapis#3291)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukesneeringer committed Apr 12, 2017
1 parent 0741a02 commit 2af68e3
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
3 changes: 0 additions & 3 deletions 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 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 2af68e3

Please sign in to comment.