Skip to content

Commit

Permalink
Do not validate sample rate. (#3290)
Browse files Browse the repository at this point in the history
Fixes #3286.
  • Loading branch information
lukesneeringer authored Apr 12, 2017
1 parent 2b31a87 commit 200a974
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
5 changes: 0 additions & 5 deletions speech/google/cloud/speech/sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,6 @@ def __init__(self, content=None, source_uri=None, stream=None,
self._content = content
self._source_uri = source_uri
self._stream = stream

if (sample_rate_hertz is not None and
not 8000 <= sample_rate_hertz <= 48000):
raise ValueError('The value of sample_rate_hertz must be between '
'8000 and 48000.')
self._sample_rate_hertz = sample_rate_hertz

if encoding is not None and getattr(Encoding, encoding, False):
Expand Down
7 changes: 0 additions & 7 deletions speech/tests/unit/test_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,6 @@ def test_bytes_converts_to_file_like_object(self):
def test_sample_rates(self):
from google.cloud.speech.encoding import Encoding

with self.assertRaises(ValueError):
self._make_one(
source_uri=self.AUDIO_SOURCE_URI, sample_rate_hertz=7999)
with self.assertRaises(ValueError):
self._make_one(
source_uri=self.AUDIO_SOURCE_URI, sample_rate_hertz=48001)

sample = self._make_one(
encoding=Encoding.FLAC,
sample_rate_hertz=self.SAMPLE_RATE,
Expand Down

0 comments on commit 200a974

Please sign in to comment.