Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6b7b9ac

Browse files
authored
Merge pull request googleapis#2963 from lukesneeringer/issue-2948
Remove default sample_rate.
2 parents 7ae80db + 89e6056 commit 6b7b9ac

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

speech/google/cloud/speech/sample.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ class Sample(object):
5353
:param client: (Optional) The client that owns this instance of sample.
5454
"""
5555
default_encoding = Encoding.FLAC
56-
default_sample_rate = 16000
5756

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

7776
if encoding is not None and getattr(Encoding, encoding, False):
7877
self._encoding = getattr(Encoding, encoding)

speech/unit_tests/test_sample.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,6 @@ def test_sample_rates(self):
9393
self.assertEqual(sample.sample_rate, self.SAMPLE_RATE)
9494
self.assertEqual(sample.encoding, Encoding.FLAC)
9595

96-
sample = self._make_one(source_uri=self.AUDIO_SOURCE_URI,
97-
encoding=Encoding.FLAC)
98-
self.assertEqual(sample.sample_rate, self.SAMPLE_RATE)
99-
10096
def test_encoding(self):
10197
from google.cloud.speech.encoding import Encoding
10298

0 commit comments

Comments
 (0)