Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove default sample_rate. #2963

Merged
merged 1 commit into from
Jan 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions 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 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