RealTimeSTT 0.3.3__tar.gz → 0.3.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {realtimestt-0.3.3 → realtimestt-0.3.5}/PKG-INFO +2 -2
- {realtimestt-0.3.3 → realtimestt-0.3.5}/README.md +1 -1
- {realtimestt-0.3.3 → realtimestt-0.3.5}/RealtimeSTT.egg-info/PKG-INFO +2 -2
- realtimestt-0.3.5/RealtimeSTT.egg-info/SOURCES.txt +16 -0
- realtimestt-0.3.5/RealtimeSTT.egg-info/entry_points.txt +3 -0
- realtimestt-0.3.5/RealtimeSTT.egg-info/top_level.txt +2 -0
- realtimestt-0.3.3/server/stt_cli_client - Kopie (5).py → realtimestt-0.3.5/RealtimeSTT_server/stt_cli_client.py +97 -56
- {realtimestt-0.3.3/server → realtimestt-0.3.5/RealtimeSTT_server}/stt_server.py +21 -21
- {realtimestt-0.3.3 → realtimestt-0.3.5}/setup.py +34 -34
- realtimestt-0.3.3/RealtimeSTT/audio_recorder - Kopie.py +0 -2653
- realtimestt-0.3.3/RealtimeSTT/audio_recorder_client - Kopie (2).py +0 -629
- realtimestt-0.3.3/RealtimeSTT/audio_recorder_client - Kopie (3).py +0 -735
- realtimestt-0.3.3/RealtimeSTT/audio_recorder_client - Kopie.py +0 -277
- realtimestt-0.3.3/RealtimeSTT.egg-info/SOURCES.txt +0 -36
- realtimestt-0.3.3/RealtimeSTT.egg-info/entry_points.txt +0 -3
- realtimestt-0.3.3/RealtimeSTT.egg-info/top_level.txt +0 -2
- realtimestt-0.3.3/server/stt_cli_client - Kopie (2).py +0 -389
- realtimestt-0.3.3/server/stt_cli_client - Kopie (3).py +0 -629
- realtimestt-0.3.3/server/stt_cli_client - Kopie (4).py +0 -506
- realtimestt-0.3.3/server/stt_cli_client - Kopie.py +0 -288
- realtimestt-0.3.3/server/stt_cli_client.py +0 -554
- realtimestt-0.3.3/server/stt_cli_client_one_channel.py +0 -389
- realtimestt-0.3.3/server/stt_cli_client_two_channels.py +0 -493
- realtimestt-0.3.3/server/stt_server - Kopie (2).py +0 -467
- realtimestt-0.3.3/server/stt_server - Kopie (3).py +0 -550
- realtimestt-0.3.3/server/stt_server - Kopie (4).py +0 -629
- realtimestt-0.3.3/server/stt_server - Kopie (5).py +0 -601
- realtimestt-0.3.3/server/stt_server - Kopie (6).py +0 -716
- realtimestt-0.3.3/server/stt_server - Kopie.py +0 -309
- realtimestt-0.3.3/server/stt_server_one_channel.py +0 -502
- realtimestt-0.3.3/server/stt_server_two_channels.py +0 -501
- realtimestt-0.3.3/server/xstt_server.py +0 -502
- {realtimestt-0.3.3 → realtimestt-0.3.5}/LICENSE +0 -0
- {realtimestt-0.3.3 → realtimestt-0.3.5}/RealtimeSTT/__init__.py +0 -0
- {realtimestt-0.3.3 → realtimestt-0.3.5}/RealtimeSTT/audio_recorder.py +0 -0
- {realtimestt-0.3.3 → realtimestt-0.3.5}/RealtimeSTT/audio_recorder_client.py +0 -0
- {realtimestt-0.3.3 → realtimestt-0.3.5}/RealtimeSTT.egg-info/dependency_links.txt +0 -0
- {realtimestt-0.3.3 → realtimestt-0.3.5}/RealtimeSTT.egg-info/requires.txt +0 -0
- {realtimestt-0.3.3/server → realtimestt-0.3.5/RealtimeSTT_server}/__init__.py +0 -0
- {realtimestt-0.3.3/server → realtimestt-0.3.5/RealtimeSTT_server}/install_packages.py +0 -0
- {realtimestt-0.3.3 → realtimestt-0.3.5}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: RealtimeSTT
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.5
|
|
4
4
|
Summary: A fast Voice Activity Detection and Transcription System
|
|
5
5
|
Home-page: https://github.com/KoljaB/RealTimeSTT
|
|
6
6
|
Author: Kolja Beigel
|
|
@@ -55,7 +55,7 @@ https://github.com/user-attachments/assets/797e6552-27cd-41b1-a7f3-e5cbc72094f5
|
|
|
55
55
|
|
|
56
56
|
### Updates
|
|
57
57
|
|
|
58
|
-
Latest Version: v0.3.
|
|
58
|
+
Latest Version: v0.3.5
|
|
59
59
|
|
|
60
60
|
See [release history](https://github.com/KoljaB/RealtimeSTT/releases).
|
|
61
61
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: RealtimeSTT
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.5
|
|
4
4
|
Summary: A fast Voice Activity Detection and Transcription System
|
|
5
5
|
Home-page: https://github.com/KoljaB/RealTimeSTT
|
|
6
6
|
Author: Kolja Beigel
|
|
@@ -55,7 +55,7 @@ https://github.com/user-attachments/assets/797e6552-27cd-41b1-a7f3-e5cbc72094f5
|
|
|
55
55
|
|
|
56
56
|
### Updates
|
|
57
57
|
|
|
58
|
-
Latest Version: v0.3.
|
|
58
|
+
Latest Version: v0.3.5
|
|
59
59
|
|
|
60
60
|
See [release history](https://github.com/KoljaB/RealtimeSTT/releases).
|
|
61
61
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
setup.py
|
|
4
|
+
RealtimeSTT/__init__.py
|
|
5
|
+
RealtimeSTT/audio_recorder.py
|
|
6
|
+
RealtimeSTT/audio_recorder_client.py
|
|
7
|
+
RealtimeSTT.egg-info/PKG-INFO
|
|
8
|
+
RealtimeSTT.egg-info/SOURCES.txt
|
|
9
|
+
RealtimeSTT.egg-info/dependency_links.txt
|
|
10
|
+
RealtimeSTT.egg-info/entry_points.txt
|
|
11
|
+
RealtimeSTT.egg-info/requires.txt
|
|
12
|
+
RealtimeSTT.egg-info/top_level.txt
|
|
13
|
+
RealtimeSTT_server/__init__.py
|
|
14
|
+
RealtimeSTT_server/install_packages.py
|
|
15
|
+
RealtimeSTT_server/stt_cli_client.py
|
|
16
|
+
RealtimeSTT_server/stt_server.py
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import sys
|
|
3
|
-
import pyaudio
|
|
4
|
-
import numpy as np
|
|
1
|
+
from urllib.parse import urlparse
|
|
5
2
|
from scipy import signal
|
|
6
|
-
import
|
|
3
|
+
from queue import Queue
|
|
4
|
+
import numpy as np
|
|
5
|
+
import subprocess
|
|
6
|
+
import threading
|
|
7
7
|
import websocket
|
|
8
8
|
import argparse
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import time
|
|
9
|
+
import pyaudio
|
|
10
|
+
import logging
|
|
12
11
|
import struct
|
|
13
12
|
import socket
|
|
14
13
|
import shutil
|
|
15
|
-
from urllib.parse import urlparse
|
|
16
14
|
import queue
|
|
17
|
-
|
|
15
|
+
import json
|
|
16
|
+
import time
|
|
17
|
+
import sys
|
|
18
|
+
import os
|
|
18
19
|
|
|
19
20
|
os.environ['ALSA_LOG_LEVEL'] = 'none'
|
|
20
21
|
|
|
@@ -23,8 +24,8 @@ CHUNK = 1024
|
|
|
23
24
|
FORMAT = pyaudio.paInt16
|
|
24
25
|
CHANNELS = 1
|
|
25
26
|
RATE = 44100
|
|
26
|
-
DEFAULT_CONTROL_URL = "ws://
|
|
27
|
-
DEFAULT_DATA_URL = "ws://
|
|
27
|
+
DEFAULT_CONTROL_URL = "ws://127.0.0.1:8011"
|
|
28
|
+
DEFAULT_DATA_URL = "ws://127.0.0.1:8012"
|
|
28
29
|
|
|
29
30
|
# Initialize colorama
|
|
30
31
|
from colorama import init, Fore, Style
|
|
@@ -38,8 +39,9 @@ class STTWebSocketClient:
|
|
|
38
39
|
self.control_url = control_url
|
|
39
40
|
self.data_url = data_url
|
|
40
41
|
self.control_ws = None
|
|
41
|
-
self.
|
|
42
|
-
self.
|
|
42
|
+
self.data_ws_app = None
|
|
43
|
+
self.data_ws_connected = None # WebSocket object that will be used for sending
|
|
44
|
+
self.is_running = True
|
|
43
45
|
self.debug = debug
|
|
44
46
|
self.file_output = file_output
|
|
45
47
|
self.last_text = ""
|
|
@@ -71,7 +73,6 @@ class STTWebSocketClient:
|
|
|
71
73
|
self.debug_print("Cannot start STT server. Exiting.")
|
|
72
74
|
return False
|
|
73
75
|
|
|
74
|
-
# websocket.enableTrace(self.debug)
|
|
75
76
|
try:
|
|
76
77
|
# Connect to control WebSocket
|
|
77
78
|
self.control_ws = websocket.WebSocketApp(self.control_url,
|
|
@@ -85,13 +86,13 @@ class STTWebSocketClient:
|
|
|
85
86
|
self.control_ws_thread.start()
|
|
86
87
|
|
|
87
88
|
# Connect to data WebSocket
|
|
88
|
-
self.
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
89
|
+
self.data_ws_app = websocket.WebSocketApp(self.data_url,
|
|
90
|
+
on_message=self.on_data_message,
|
|
91
|
+
on_error=self.on_error,
|
|
92
|
+
on_close=self.on_close,
|
|
93
|
+
on_open=self.on_data_open)
|
|
93
94
|
|
|
94
|
-
self.data_ws_thread = threading.Thread(target=self.
|
|
95
|
+
self.data_ws_thread = threading.Thread(target=self.data_ws_app.run_forever)
|
|
95
96
|
self.data_ws_thread.daemon = False # Set to False to ensure proper shutdown
|
|
96
97
|
self.data_ws_thread.start()
|
|
97
98
|
|
|
@@ -113,7 +114,7 @@ class STTWebSocketClient:
|
|
|
113
114
|
|
|
114
115
|
def on_data_open(self, ws):
|
|
115
116
|
self.debug_print("Data WebSocket connection opened.")
|
|
116
|
-
self.
|
|
117
|
+
self.data_ws_connected = ws # Store the connected websocket object for sending data
|
|
117
118
|
self.start_recording()
|
|
118
119
|
|
|
119
120
|
def on_error(self, ws, error):
|
|
@@ -139,8 +140,57 @@ class STTWebSocketClient:
|
|
|
139
140
|
if os.name == 'nt': # Windows
|
|
140
141
|
subprocess.Popen('start /min cmd /c stt-server', shell=True)
|
|
141
142
|
else: # Unix-like systems
|
|
142
|
-
|
|
143
|
-
|
|
143
|
+
terminal_emulators = [
|
|
144
|
+
'gnome-terminal',
|
|
145
|
+
'x-terminal-emulator',
|
|
146
|
+
'konsole',
|
|
147
|
+
'xfce4-terminal',
|
|
148
|
+
'lxterminal',
|
|
149
|
+
'xterm',
|
|
150
|
+
'mate-terminal',
|
|
151
|
+
'terminator',
|
|
152
|
+
'tilix',
|
|
153
|
+
'alacritty',
|
|
154
|
+
'urxvt',
|
|
155
|
+
'eterm',
|
|
156
|
+
'rxvt',
|
|
157
|
+
'kitty',
|
|
158
|
+
'hyper'
|
|
159
|
+
]
|
|
160
|
+
|
|
161
|
+
terminal = None
|
|
162
|
+
for term in terminal_emulators:
|
|
163
|
+
if shutil.which(term):
|
|
164
|
+
terminal = term
|
|
165
|
+
break
|
|
166
|
+
|
|
167
|
+
if terminal:
|
|
168
|
+
terminal_exec_options = {
|
|
169
|
+
'x-terminal-emulator': ['--'],
|
|
170
|
+
'gnome-terminal': ['--'],
|
|
171
|
+
'mate-terminal': ['--'],
|
|
172
|
+
'terminator': ['--'],
|
|
173
|
+
'tilix': ['--'],
|
|
174
|
+
'konsole': ['-e'],
|
|
175
|
+
'xfce4-terminal': ['-e'],
|
|
176
|
+
'lxterminal': ['-e'],
|
|
177
|
+
'alacritty': ['-e'],
|
|
178
|
+
'xterm': ['-e'],
|
|
179
|
+
'rxvt': ['-e'],
|
|
180
|
+
'urxvt': ['-e'],
|
|
181
|
+
'eterm': ['-e'],
|
|
182
|
+
'kitty': [],
|
|
183
|
+
'hyper': ['--command']
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
exec_option = terminal_exec_options.get(terminal, None)
|
|
187
|
+
if exec_option is not None:
|
|
188
|
+
subprocess.Popen([terminal] + exec_option + ['stt-server'], start_new_session=True)
|
|
189
|
+
print(f"STT server started in a new terminal window using {terminal}.", file=sys.stderr)
|
|
190
|
+
else:
|
|
191
|
+
print(f"Unsupported terminal emulator '{terminal}'. Please start the STT server manually.", file=sys.stderr)
|
|
192
|
+
else:
|
|
193
|
+
print("No supported terminal emulator found. Please start the STT server manually.", file=sys.stderr)
|
|
144
194
|
|
|
145
195
|
def ensure_server_running(self):
|
|
146
196
|
if not self.is_server_running():
|
|
@@ -161,14 +211,11 @@ class STTWebSocketClient:
|
|
|
161
211
|
return False
|
|
162
212
|
return True
|
|
163
213
|
|
|
164
|
-
# Handle control messages like set_parameter, get_parameter, etc.
|
|
165
214
|
def on_control_message(self, ws, message):
|
|
166
215
|
try:
|
|
167
216
|
data = json.loads(message)
|
|
168
|
-
# Handle server response with status
|
|
169
217
|
if 'status' in data:
|
|
170
218
|
if data['status'] == 'success':
|
|
171
|
-
# print(f"Server Response: {data.get('message', '')}")
|
|
172
219
|
if 'parameter' in data and 'value' in data:
|
|
173
220
|
print(f"Parameter {data['parameter']} = {data['value']}")
|
|
174
221
|
elif data['status'] == 'error':
|
|
@@ -180,19 +227,16 @@ class STTWebSocketClient:
|
|
|
180
227
|
except Exception as e:
|
|
181
228
|
self.debug_print(f"Error processing control message: {e}")
|
|
182
229
|
|
|
183
|
-
# Handle real-time transcription and full sentence updates
|
|
184
230
|
def on_data_message(self, ws, message):
|
|
185
231
|
try:
|
|
186
232
|
data = json.loads(message)
|
|
187
|
-
|
|
188
|
-
if
|
|
233
|
+
message_type = data.get('type')
|
|
234
|
+
if message_type == 'realtime':
|
|
189
235
|
if data['text'] != self.last_text:
|
|
190
236
|
self.last_text = data['text']
|
|
191
237
|
if not self.norealtime:
|
|
192
238
|
self.update_progress_bar(self.last_text)
|
|
193
|
-
|
|
194
|
-
# Handle full sentences
|
|
195
|
-
elif data.get('type') == 'fullSentence':
|
|
239
|
+
elif message_type == 'fullSentence':
|
|
196
240
|
if self.file_output:
|
|
197
241
|
sys.stderr.write('\r\033[K')
|
|
198
242
|
sys.stderr.write(data['text'])
|
|
@@ -204,6 +248,16 @@ class STTWebSocketClient:
|
|
|
204
248
|
self.finish_progress_bar()
|
|
205
249
|
print(f"{data['text']}")
|
|
206
250
|
self.stop()
|
|
251
|
+
elif message_type in {
|
|
252
|
+
'vad_detect_start',
|
|
253
|
+
'vad_detect_stop',
|
|
254
|
+
'recording_start',
|
|
255
|
+
'recording_stop',
|
|
256
|
+
'wakeword_detected',
|
|
257
|
+
'wakeword_detection_start',
|
|
258
|
+
'wakeword_detection_end',
|
|
259
|
+
'transcription_start'}:
|
|
260
|
+
pass # Known message types, no action needed
|
|
207
261
|
|
|
208
262
|
else:
|
|
209
263
|
self.debug_print(f"Unknown data message format: {data}")
|
|
@@ -248,10 +302,11 @@ class STTWebSocketClient:
|
|
|
248
302
|
self.finish_progress_bar()
|
|
249
303
|
self.is_running = False
|
|
250
304
|
self.stop_event.set()
|
|
305
|
+
self.debug_print("Stopping client and cleaning up resources.")
|
|
251
306
|
if self.control_ws:
|
|
252
307
|
self.control_ws.close()
|
|
253
|
-
if self.
|
|
254
|
-
self.
|
|
308
|
+
if self.data_ws_connected:
|
|
309
|
+
self.data_ws_connected.close()
|
|
255
310
|
|
|
256
311
|
# Join threads to ensure they finish before exiting
|
|
257
312
|
if self.control_ws_thread:
|
|
@@ -288,7 +343,7 @@ class STTWebSocketClient:
|
|
|
288
343
|
metadata_json = json.dumps(metadata)
|
|
289
344
|
metadata_length = len(metadata_json)
|
|
290
345
|
message = struct.pack('<I', metadata_length) + metadata_json.encode('utf-8') + audio_data
|
|
291
|
-
self.
|
|
346
|
+
self.data_ws_connected.send(message, opcode=websocket.ABNF.OPCODE_BINARY)
|
|
292
347
|
except Exception as e:
|
|
293
348
|
self.debug_print(f"Error sending audio data: {e}")
|
|
294
349
|
break # Exit the recording loop
|
|
@@ -320,10 +375,10 @@ class STTWebSocketClient:
|
|
|
320
375
|
frames_per_buffer=CHUNK,
|
|
321
376
|
input_device_index=self.input_device_index,
|
|
322
377
|
)
|
|
323
|
-
self.debug_print(f"Audio recording initialized successfully at {self.device_sample_rate} Hz")
|
|
378
|
+
self.debug_print(f"Audio recording initialized successfully at {self.device_sample_rate} Hz, device index {self.input_device_index}")
|
|
324
379
|
return True
|
|
325
380
|
except Exception as e:
|
|
326
|
-
self.debug_print(f"Failed to initialize audio stream at {self.device_sample_rate} Hz: {e}")
|
|
381
|
+
self.debug_print(f"Failed to initialize audio stream at {self.device_sample_rate} Hz, device index {self.input_device_index}: {e}")
|
|
327
382
|
return False
|
|
328
383
|
|
|
329
384
|
except Exception as e:
|
|
@@ -374,9 +429,7 @@ class STTWebSocketClient:
|
|
|
374
429
|
self.command_thread.start()
|
|
375
430
|
|
|
376
431
|
def command_processor(self):
|
|
377
|
-
# print(f"Starting command processor")
|
|
378
432
|
self.debug_print(f"Starting command processor")
|
|
379
|
-
#while self.is_running and not self.stop_event.is_set():
|
|
380
433
|
while not self.stop_event.is_set():
|
|
381
434
|
try:
|
|
382
435
|
command = self.commands.get(timeout=0.1)
|
|
@@ -386,14 +439,12 @@ class STTWebSocketClient:
|
|
|
386
439
|
self.get_parameter(command['parameter'])
|
|
387
440
|
elif command['type'] == 'call_method':
|
|
388
441
|
self.call_method(command['method'], command.get('args'), command.get('kwargs'))
|
|
389
|
-
except queue.Empty:
|
|
390
|
-
continue
|
|
442
|
+
except queue.Empty:
|
|
443
|
+
continue
|
|
391
444
|
except Exception as e:
|
|
392
445
|
self.debug_print(f"Error in command processor: {e}")
|
|
393
|
-
# finally:
|
|
394
|
-
#print(f"Leaving command processor")
|
|
395
|
-
self.debug_print(f"Leaving command processor")
|
|
396
446
|
|
|
447
|
+
self.debug_print(f"Leaving command processor")
|
|
397
448
|
|
|
398
449
|
def add_command(self, command):
|
|
399
450
|
self.commands.put(command)
|
|
@@ -433,7 +484,6 @@ def main():
|
|
|
433
484
|
if args.set_param:
|
|
434
485
|
for param, value in args.set_param:
|
|
435
486
|
try:
|
|
436
|
-
# Attempt to parse the value to the appropriate type
|
|
437
487
|
if '.' in value:
|
|
438
488
|
value = float(value)
|
|
439
489
|
else:
|
|
@@ -466,22 +516,12 @@ def main():
|
|
|
466
516
|
})
|
|
467
517
|
|
|
468
518
|
# If command-line parameters were used (like --get-param), wait for them to be processed
|
|
469
|
-
#print("waiting for client commands empty")
|
|
470
|
-
#count = 0
|
|
471
519
|
if args.set_param or args.get_param or args.call_method:
|
|
472
|
-
#while not client.commands.empty():
|
|
473
520
|
while not client.commands.empty():
|
|
474
|
-
# print("x", end="", flush=True)
|
|
475
521
|
time.sleep(0.1)
|
|
476
|
-
# count += 1
|
|
477
|
-
# if count > 20:
|
|
478
|
-
# print("BREAK")
|
|
479
|
-
# break
|
|
480
522
|
|
|
481
523
|
# Start recording directly if no command-line params were provided
|
|
482
|
-
# print("Connection established. Recording... (Press Ctrl+C to stop)", file=sys.stderr)
|
|
483
524
|
while client.is_running:
|
|
484
|
-
# print(".", end="", flush=True)
|
|
485
525
|
time.sleep(0.1)
|
|
486
526
|
|
|
487
527
|
else:
|
|
@@ -493,3 +533,4 @@ def main():
|
|
|
493
533
|
|
|
494
534
|
if __name__ == "__main__":
|
|
495
535
|
main()
|
|
536
|
+
|
|
@@ -68,7 +68,7 @@ The server will broadcast real-time transcription updates to all connected clien
|
|
|
68
68
|
|
|
69
69
|
extended_logging = True
|
|
70
70
|
send_recorded_chunk = False
|
|
71
|
-
log_incoming_chunks =
|
|
71
|
+
log_incoming_chunks = True
|
|
72
72
|
stt_optimizations = False
|
|
73
73
|
|
|
74
74
|
|
|
@@ -259,23 +259,23 @@ def on_transcription_start(loop):
|
|
|
259
259
|
})
|
|
260
260
|
asyncio.run_coroutine_threadsafe(audio_queue.put(message), loop)
|
|
261
261
|
|
|
262
|
-
def on_realtime_transcription_update(text, loop):
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
def on_recorded_chunk(chunk, loop):
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
262
|
+
# def on_realtime_transcription_update(text, loop):
|
|
263
|
+
# # Send real-time transcription updates to the client
|
|
264
|
+
# text = preprocess_text(text)
|
|
265
|
+
# message = json.dumps({
|
|
266
|
+
# 'type': 'realtime_update',
|
|
267
|
+
# 'text': text
|
|
268
|
+
# })
|
|
269
|
+
# asyncio.run_coroutine_threadsafe(audio_queue.put(message), loop)
|
|
270
|
+
|
|
271
|
+
# def on_recorded_chunk(chunk, loop):
|
|
272
|
+
# if send_recorded_chunk:
|
|
273
|
+
# bytes_b64 = base64.b64encode(chunk.tobytes()).decode('utf-8')
|
|
274
|
+
# message = json.dumps({
|
|
275
|
+
# 'type': 'recorded_chunk',
|
|
276
|
+
# 'bytes': bytes_b64
|
|
277
|
+
# })
|
|
278
|
+
# asyncio.run_coroutine_threadsafe(audio_queue.put(message), loop)
|
|
279
279
|
|
|
280
280
|
# Define the server's arguments
|
|
281
281
|
def parse_arguments():
|
|
@@ -346,7 +346,7 @@ def parse_arguments():
|
|
|
346
346
|
parser.add_argument('--data_port', type=int, default=8012,
|
|
347
347
|
help='The port number used for the data WebSocket connection. Data connections are used to send audio data and receive transcription updates in real time. Default is port 8012.')
|
|
348
348
|
|
|
349
|
-
parser.add_argument('--wake_words', type=str, default="
|
|
349
|
+
parser.add_argument('--wake_words', type=str, default="",
|
|
350
350
|
help='Specify the wake word(s) that will trigger the server to start listening. For example, setting this to "Jarvis" will make the system start transcribing when it detects the wake word "Jarvis". Default is "Jarvis".')
|
|
351
351
|
|
|
352
352
|
parser.add_argument('--wake_words_sensitivity', type=float, default=0.5,
|
|
@@ -358,7 +358,7 @@ def parse_arguments():
|
|
|
358
358
|
parser.add_argument('--wake_word_activation_delay', type=float, default=20,
|
|
359
359
|
help='The delay in seconds before the wake word detection is activated after the system starts listening. This prevents false positives during the start of a session. Default is 0.5 seconds.')
|
|
360
360
|
|
|
361
|
-
parser.add_argument('--wakeword_backend', type=str, default='
|
|
361
|
+
parser.add_argument('--wakeword_backend', type=str, default='none',
|
|
362
362
|
help='The backend used for wake word detection. You can specify different backends such as "default" or any custom implementations depending on your setup. Default is "pvporcupine".')
|
|
363
363
|
|
|
364
364
|
parser.add_argument('--openwakeword_model_paths', type=str, nargs='*',
|
|
@@ -619,7 +619,7 @@ async def main_async():
|
|
|
619
619
|
'on_wakeword_detection_start': make_callback(loop, on_wakeword_detection_start),
|
|
620
620
|
'on_wakeword_detection_end': make_callback(loop, on_wakeword_detection_end),
|
|
621
621
|
'on_transcription_start': make_callback(loop, on_transcription_start),
|
|
622
|
-
'on_recorded_chunk': make_callback(loop, on_recorded_chunk),
|
|
622
|
+
# 'on_recorded_chunk': make_callback(loop, on_recorded_chunk),
|
|
623
623
|
'no_log_file': True, # Disable logging to file
|
|
624
624
|
'use_extended_logging': args.use_extended_logging,
|
|
625
625
|
}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import setuptools
|
|
2
|
-
|
|
3
|
-
with open("README.md", "r") as fh:
|
|
4
|
-
long_description = fh.read()
|
|
5
|
-
|
|
6
|
-
# Read requirements.txt
|
|
7
|
-
with open('requirements.txt') as f:
|
|
8
|
-
requirements = f.read().splitlines()
|
|
9
|
-
|
|
10
|
-
setuptools.setup(
|
|
11
|
-
name="RealtimeSTT",
|
|
12
|
-
version="0.3.
|
|
13
|
-
author="Kolja Beigel",
|
|
14
|
-
author_email="kolja.beigel@web.de",
|
|
15
|
-
description="A fast Voice Activity Detection and Transcription System",
|
|
16
|
-
long_description=long_description,
|
|
17
|
-
long_description_content_type="text/markdown",
|
|
18
|
-
url="https://github.com/KoljaB/RealTimeSTT",
|
|
19
|
-
packages=setuptools.find_packages(),
|
|
20
|
-
classifiers=[
|
|
21
|
-
"Programming Language :: Python :: 3",
|
|
22
|
-
"License :: OSI Approved :: MIT License",
|
|
23
|
-
"Operating System :: OS Independent",
|
|
24
|
-
],
|
|
25
|
-
python_requires='>=3.6',
|
|
26
|
-
install_requires=requirements,
|
|
27
|
-
keywords="real-time, audio, transcription, speech-to-text, voice-activity-detection, VAD, real-time-transcription, ambient-noise-detection, microphone-input, faster_whisper, speech-recognition, voice-assistants, audio-processing, buffered-transcription, pyaudio, ambient-noise-level, voice-deactivity",
|
|
28
|
-
entry_points={
|
|
29
|
-
'console_scripts': [
|
|
30
|
-
'stt-server=
|
|
31
|
-
'stt=
|
|
32
|
-
],
|
|
33
|
-
},
|
|
34
|
-
)
|
|
1
|
+
import setuptools
|
|
2
|
+
|
|
3
|
+
with open("README.md", "r") as fh:
|
|
4
|
+
long_description = fh.read()
|
|
5
|
+
|
|
6
|
+
# Read requirements.txt
|
|
7
|
+
with open('requirements.txt') as f:
|
|
8
|
+
requirements = f.read().splitlines()
|
|
9
|
+
|
|
10
|
+
setuptools.setup(
|
|
11
|
+
name="RealtimeSTT",
|
|
12
|
+
version="0.3.5",
|
|
13
|
+
author="Kolja Beigel",
|
|
14
|
+
author_email="kolja.beigel@web.de",
|
|
15
|
+
description="A fast Voice Activity Detection and Transcription System",
|
|
16
|
+
long_description=long_description,
|
|
17
|
+
long_description_content_type="text/markdown",
|
|
18
|
+
url="https://github.com/KoljaB/RealTimeSTT",
|
|
19
|
+
packages=setuptools.find_packages(include=["RealtimeSTT", "RealtimeSTT_server"]),
|
|
20
|
+
classifiers=[
|
|
21
|
+
"Programming Language :: Python :: 3",
|
|
22
|
+
"License :: OSI Approved :: MIT License",
|
|
23
|
+
"Operating System :: OS Independent",
|
|
24
|
+
],
|
|
25
|
+
python_requires='>=3.6',
|
|
26
|
+
install_requires=requirements,
|
|
27
|
+
keywords="real-time, audio, transcription, speech-to-text, voice-activity-detection, VAD, real-time-transcription, ambient-noise-detection, microphone-input, faster_whisper, speech-recognition, voice-assistants, audio-processing, buffered-transcription, pyaudio, ambient-noise-level, voice-deactivity",
|
|
28
|
+
entry_points={
|
|
29
|
+
'console_scripts': [
|
|
30
|
+
'stt-server=RealtimeSTT_server.stt_server:main',
|
|
31
|
+
'stt=RealtimeSTT_server.stt_cli_client:main',
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
)
|