From 386dd99c189000a5eb9c5056f028ce86488c352e Mon Sep 17 00:00:00 2001 From: pencilpusher <83676301+jakethesnake420@users.noreply.github.com> Date: Thu, 18 Jan 2024 01:02:21 -0600 Subject: [PATCH 1/2] Update streamingclient.py --- src/rev_ai/streamingclient.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rev_ai/streamingclient.py b/src/rev_ai/streamingclient.py index e91cca5b..43225021 100644 --- a/src/rev_ai/streamingclient.py +++ b/src/rev_ai/streamingclient.py @@ -146,7 +146,7 @@ def _start_send_data_thread(self, generator): raise ValueError('generator must be provided') if hasattr(self, 'request_thread'): - if self.request_thread.isAlive(): + if self.request_thread.is_alive(): raise RuntimeError("""Data is still being sent and will interfere with the responses.""") From cc5c9accd34ca66c04a03568b523087b644d31a2 Mon Sep 17 00:00:00 2001 From: pencilpusher <83676301+jakethesnake420@users.noreply.github.com> Date: Tue, 5 Mar 2024 03:16:06 -0600 Subject: [PATCH 2/2] max_segment_duration_seconds --- src/rev_ai/streamingclient.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/rev_ai/streamingclient.py b/src/rev_ai/streamingclient.py index 43225021..3ed01f7e 100644 --- a/src/rev_ai/streamingclient.py +++ b/src/rev_ai/streamingclient.py @@ -73,7 +73,8 @@ def start(self, start_ts=None, transcriber=None, language=None, - skip_postprocessing=None): + skip_postprocessing=None, + max_segment_duration_seconds=None): """Function to connect the websocket to the URL and start the response thread :param generator: generator object that yields binary audio data @@ -124,6 +125,9 @@ def start(self, if skip_postprocessing: url += '&' + urlencode({'skip_postprocessing': 'true'}) + if max_segment_duration_seconds: + url += '&' + urlencode({'max_segment_duration_seconds': max_segment_duration_seconds}) + try: self.client.connect(url) except Exception as e: