Skip to content

Commit

Permalink
Merge pull request #2963 from lukesneeringer/issue-2948
Browse files Browse the repository at this point in the history
Remove default sample_rate.
  • Loading branch information
daspecster authored Jan 25, 2017
2 parents 935c676 + 756f076 commit 9c416a8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
3 changes: 1 addition & 2 deletions packages/google-cloud-speech/google/cloud/speech/sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ class Sample(object):
:param client: (Optional) The client that owns this instance of sample.
"""
default_encoding = Encoding.FLAC
default_sample_rate = 16000

def __init__(self, content=None, source_uri=None, stream=None,
encoding=None, sample_rate=None, client=None):
Expand All @@ -72,7 +71,7 @@ def __init__(self, content=None, source_uri=None, stream=None,
if sample_rate is not None and not 8000 <= sample_rate <= 48000:
raise ValueError('The value of sample_rate must be between 8000'
' and 48000.')
self._sample_rate = sample_rate or self.default_sample_rate
self._sample_rate = sample_rate

if encoding is not None and getattr(Encoding, encoding, False):
self._encoding = getattr(Encoding, encoding)
Expand Down
4 changes: 0 additions & 4 deletions packages/google-cloud-speech/unit_tests/test_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,6 @@ def test_sample_rates(self):
self.assertEqual(sample.sample_rate, self.SAMPLE_RATE)
self.assertEqual(sample.encoding, Encoding.FLAC)

sample = self._make_one(source_uri=self.AUDIO_SOURCE_URI,
encoding=Encoding.FLAC)
self.assertEqual(sample.sample_rate, self.SAMPLE_RATE)

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

Expand Down

0 comments on commit 9c416a8

Please sign in to comment.