Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f576f9e

Browse filesBrowse files
committed
Update based on feedback
1 parent 0b009fb commit f576f9e
Copy full SHA for f576f9e

File tree

Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed

‎speech/cloud-client/transcribe_streaming_indefinite.py

Copy file name to clipboardExpand all lines: speech/cloud-client/transcribe_streaming_indefinite.py
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ def duration_to_secs(duration):
5353

5454
class ResumableMicrophoneStream:
5555
"""Opens a recording stream as a generator yielding the audio chunks."""
56-
def __init__(self):
57-
self._rate = SAMPLE_RATE
58-
self._chunk_size = CHUNK_SIZE
56+
def __init__(self, rate, chunk_size):
57+
self._rate = rate
58+
self._chunk_size = chunk_size
5959
self._num_channels = 1
6060
self._max_replay_secs = 5
6161

@@ -201,7 +201,7 @@ def main():
201201
config=config,
202202
interim_results=True)
203203

204-
mic_manager = ResumableMicrophoneStream()
204+
mic_manager = ResumableMicrophoneStream(SAMPLE_RATE, CHUNK_SIZE)
205205

206206
print('Say "Quit" or "Exit" to terminate the program.')
207207

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.