Skip to content

Commit f7d74ca

Browse files
Do not force LRO to be LINEAR16 only in Speech. (googleapis#3291)
Fixes googleapis#3285
1 parent 19e5608 commit f7d74ca

2 files changed

Lines changed: 0 additions & 14 deletions

File tree

speech/google/cloud/speech/sample.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,6 @@ def long_running_recognize(self, language_code, max_alternatives=None,
165165
:rtype: :class:`~google.cloud.speech.operation.Operation`
166166
:returns: Operation for asynchronous request to Google Speech API.
167167
"""
168-
if self.encoding is not Encoding.LINEAR16:
169-
raise ValueError('Only LINEAR16 encoding is supported by '
170-
'long-running speech requests.')
171168
api = self._client.speech_api
172169
return api.long_running_recognize(
173170
self, language_code, max_alternatives, profanity_filter,

speech/tests/unit/test_sample.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,3 @@ def test_encoding(self):
112112
source_uri=self.AUDIO_SOURCE_URI,
113113
)
114114
self.assertEqual(sample.encoding, Encoding.FLAC)
115-
116-
def test_async_linear16_only(self):
117-
from google.cloud.speech.encoding import Encoding
118-
119-
sample = self._make_one(
120-
encoding=Encoding.FLAC,
121-
sample_rate_hertz=self.SAMPLE_RATE,
122-
source_uri=self.AUDIO_SOURCE_URI,
123-
)
124-
with self.assertRaises(ValueError):
125-
sample.long_running_recognize(language_code='en-US')

0 commit comments

Comments
 (0)