Skip to content

Commit 80e82ce

Browse files
author
Jerjou Cheng
committed
Add region tags
1 parent 3be22b9 commit 80e82ce

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

speech/api/speech_streaming.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ def make_channel(host, port):
5656
return implementations.secure_channel(host, port, composite_channel)
5757

5858

59+
# [START audio_stream]
5960
@contextlib.contextmanager
6061
def record_audio(channels, rate, chunk):
6162
"""Opens a recording stream in a context manager."""
@@ -70,6 +71,7 @@ def record_audio(channels, rate, chunk):
7071
audio_stream.stop_stream()
7172
audio_stream.close()
7273
audio_interface.terminate()
74+
# [END audio_stream]
7375

7476

7577
def request_stream(stop_audio, channels=CHANNELS, rate=RATE, chunk=CHUNK):

0 commit comments

Comments
 (0)