RealTimeSTT 0.3.91__tar.gz → 0.3.93__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: RealtimeSTT
3
- Version: 0.3.91
3
+ Version: 0.3.93
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
@@ -13,7 +13,7 @@ Requires-Python: >=3.6
13
13
  Description-Content-Type: text/markdown
14
14
  License-File: LICENSE
15
15
  Requires-Dist: PyAudio==0.2.14
16
- Requires-Dist: faster-whisper==1.0.3
16
+ Requires-Dist: faster-whisper==1.1.0
17
17
  Requires-Dist: pvporcupine==1.9.5
18
18
  Requires-Dist: webrtcvad-wheels==2.0.14
19
19
  Requires-Dist: halo==0.0.31
@@ -21,7 +21,7 @@ Requires-Dist: torch
21
21
  Requires-Dist: torchaudio
22
22
  Requires-Dist: scipy==1.14.1
23
23
  Requires-Dist: openwakeword>=0.4.0
24
- Requires-Dist: websockets==v12.0
24
+ Requires-Dist: websockets==14.1
25
25
  Requires-Dist: websocket-client==1.8.0
26
26
  Requires-Dist: numpy<2.0.0
27
27
 
@@ -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.9
58
+ Latest Version: v0.3.92
59
59
 
60
60
  See [release history](https://github.com/KoljaB/RealtimeSTT/releases).
61
61
 
@@ -136,6 +136,8 @@ Although it is possible to run RealtimeSTT with a CPU installation only (use a s
136
136
  Before installing RealtimeSTT please execute:
137
137
 
138
138
  ```bash
139
+ sudo apt-get update
140
+ sudo apt-get install python3-dev
139
141
  sudo apt-get install portaudio19-dev
140
142
  ```
141
143
 
@@ -28,7 +28,7 @@ https://github.com/user-attachments/assets/797e6552-27cd-41b1-a7f3-e5cbc72094f5
28
28
 
29
29
  ### Updates
30
30
 
31
- Latest Version: v0.3.9
31
+ Latest Version: v0.3.92
32
32
 
33
33
  See [release history](https://github.com/KoljaB/RealtimeSTT/releases).
34
34
 
@@ -109,6 +109,8 @@ Although it is possible to run RealtimeSTT with a CPU installation only (use a s
109
109
  Before installing RealtimeSTT please execute:
110
110
 
111
111
  ```bash
112
+ sudo apt-get update
113
+ sudo apt-get install python3-dev
112
114
  sudo apt-get install portaudio19-dev
113
115
  ```
114
116
 
@@ -139,8 +139,13 @@ class TranscriptionWorker:
139
139
  device_index=self.gpu_device_index,
140
140
  download_root=self.download_root,
141
141
  )
142
+ # Create a short dummy audio array, for example 1 second of silence at 16 kHz
142
143
  if self.batch_size > 0:
143
144
  model = BatchedInferencePipeline(model=model)
145
+
146
+ # Run a warm-up transcription
147
+ dummy_audio = np.zeros(16000, dtype=np.float32)
148
+ model.transcribe(dummy_audio, language="en", beam_size=1)
144
149
  except Exception as e:
145
150
  logging.exception(f"Error initializing main faster_whisper transcription model: {e}")
146
151
  raise
@@ -281,6 +286,7 @@ class AudioToTextRecorder:
281
286
  buffer_size: int = BUFFER_SIZE,
282
287
  sample_rate: int = SAMPLE_RATE,
283
288
  initial_prompt: Optional[Union[str, Iterable[int]]] = None,
289
+ initial_prompt_realtime: Optional[Union[str, Iterable[int]]] = None,
284
290
  suppress_tokens: Optional[List[int]] = [-1],
285
291
  print_transcription_time: bool = False,
286
292
  early_transcription_on_silence: int = 0,
@@ -294,12 +300,12 @@ class AudioToTextRecorder:
294
300
 
295
301
  Args:
296
302
  - model (str, default="tiny"): Specifies the size of the transcription
297
- model to use or the path to a converted model directory.
298
- Valid options are 'tiny', 'tiny.en', 'base', 'base.en',
299
- 'small', 'small.en', 'medium', 'medium.en', 'large-v1',
300
- 'large-v2'.
301
- If a specific size is provided, the model is downloaded
302
- from the Hugging Face Hub.
303
+ model to use or the path to a converted model directory.
304
+ Valid options are 'tiny', 'tiny.en', 'base', 'base.en',
305
+ 'small', 'small.en', 'medium', 'medium.en', 'large-v1',
306
+ 'large-v2'.
307
+ If a specific size is provided, the model is downloaded
308
+ from the Hugging Face Hub.
303
309
  - download_root (str, default=None): Specifies the root path were the Whisper models
304
310
  are downloaded to. When empty, the default is used.
305
311
  - language (str, default=""): Language code for speech-to-text engine.
@@ -472,7 +478,9 @@ class AudioToTextRecorder:
472
478
  recording. Changing this will very probably functionality (as the
473
479
  WebRTC VAD model is very sensitive towards the sample rate).
474
480
  - initial_prompt (str or iterable of int, default=None): Initial
475
- prompt to be fed to the transcription models.
481
+ prompt to be fed to the main transcription model.
482
+ - initial_prompt_realtime (str or iterable of int, default=None):
483
+ Initial prompt to be fed to the real-time transcription model.
476
484
  - suppress_tokens (list of int, default=[-1]): Tokens to be suppressed
477
485
  from the transcription output.
478
486
  - print_transcription_time (bool, default=False): Logs processing time
@@ -533,6 +541,8 @@ class AudioToTextRecorder:
533
541
  self.enable_realtime_transcription = enable_realtime_transcription
534
542
  self.use_main_model_for_realtime = use_main_model_for_realtime
535
543
  self.main_model_type = model
544
+ if not download_root:
545
+ download_root = None
536
546
  self.download_root = download_root
537
547
  self.realtime_model_type = realtime_model_type
538
548
  self.realtime_processing_pause = realtime_processing_pause
@@ -583,6 +593,7 @@ class AudioToTextRecorder:
583
593
  self.last_transcription_bytes = None
584
594
  self.last_transcription_bytes_b64 = None
585
595
  self.initial_prompt = initial_prompt
596
+ self.initial_prompt_realtime = initial_prompt_realtime
586
597
  self.suppress_tokens = suppress_tokens
587
598
  self.use_wake_words = wake_words or wakeword_backend in {'oww', 'openwakeword', 'openwakewords'}
588
599
  self.detected_language = None
@@ -697,7 +708,11 @@ class AudioToTextRecorder:
697
708
  if self.enable_realtime_transcription and not self.use_main_model_for_realtime:
698
709
  try:
699
710
  logging.info("Initializing faster_whisper realtime "
700
- f"transcription model {self.realtime_model_type}"
711
+ f"transcription model {self.realtime_model_type}, "
712
+ f"default device: {self.device}, "
713
+ f"compute type: {self.compute_type}, "
714
+ f"device index: {self.gpu_device_index}, "
715
+ f"download root: {self.download_root}"
701
716
  )
702
717
  self.realtime_model_type = faster_whisper.WhisperModel(
703
718
  model_size_or_path=self.realtime_model_type,
@@ -708,7 +723,8 @@ class AudioToTextRecorder:
708
723
  )
709
724
  if self.realtime_batch_size > 0:
710
725
  self.realtime_model_type = BatchedInferencePipeline(model=self.realtime_model_type)
711
-
726
+ dummy_audio = np.zeros(16000, dtype=np.float32)
727
+ self.realtime_model_type.transcribe(dummy_audio, language="en", beam_size=1)
712
728
  except Exception as e:
713
729
  logging.exception("Error initializing faster_whisper "
714
730
  f"realtime transcription model: {e}"
@@ -2104,7 +2120,7 @@ class AudioToTextRecorder:
2104
2120
  audio_array,
2105
2121
  language=self.language if self.language else None,
2106
2122
  beam_size=self.beam_size_realtime,
2107
- initial_prompt=self.initial_prompt,
2123
+ initial_prompt=self.initial_prompt_realtime,
2108
2124
  suppress_tokens=self.suppress_tokens,
2109
2125
  batch_size=self.realtime_batch_size
2110
2126
  )
@@ -2113,7 +2129,7 @@ class AudioToTextRecorder:
2113
2129
  audio_array,
2114
2130
  language=self.language if self.language else None,
2115
2131
  beam_size=self.beam_size_realtime,
2116
- initial_prompt=self.initial_prompt,
2132
+ initial_prompt=self.initial_prompt_realtime,
2117
2133
  suppress_tokens=self.suppress_tokens
2118
2134
  )
2119
2135
 
@@ -28,6 +28,7 @@ DEFAULT_DATA_URL = "ws://127.0.0.1:8012"
28
28
  INIT_MODEL_TRANSCRIPTION = "tiny"
29
29
  INIT_MODEL_TRANSCRIPTION_REALTIME = "tiny"
30
30
  INIT_REALTIME_PROCESSING_PAUSE = 0.2
31
+ INIT_REALTIME_INITIAL_PAUSE = 0.2
31
32
  INIT_SILERO_SENSITIVITY = 0.4
32
33
  INIT_WEBRTC_SENSITIVITY = 3
33
34
  INIT_POST_SPEECH_SILENCE_DURATION = 0.6
@@ -68,6 +69,7 @@ class AudioToTextRecorderClient:
68
69
 
69
70
  def __init__(self,
70
71
  model: str = INIT_MODEL_TRANSCRIPTION,
72
+ download_root: str = None,
71
73
  language: str = "",
72
74
  compute_type: str = "default",
73
75
  input_device_index: int = None,
@@ -81,14 +83,17 @@ class AudioToTextRecorderClient:
81
83
  use_microphone=True,
82
84
  spinner=True,
83
85
  level=logging.WARNING,
86
+ batch_size: int = 16,
84
87
 
85
88
  # Realtime transcription parameters
86
89
  enable_realtime_transcription=False,
87
90
  use_main_model_for_realtime=False,
88
91
  realtime_model_type=INIT_MODEL_TRANSCRIPTION_REALTIME,
89
92
  realtime_processing_pause=INIT_REALTIME_PROCESSING_PAUSE,
93
+ init_realtime_after_seconds=INIT_REALTIME_INITIAL_PAUSE,
90
94
  on_realtime_transcription_update=None,
91
95
  on_realtime_transcription_stabilized=None,
96
+ realtime_batch_size: int = 16,
92
97
 
93
98
  # Voice activation parameters
94
99
  silero_sensitivity: float = INIT_SILERO_SENSITIVITY,
@@ -133,6 +138,7 @@ class AudioToTextRecorderClient:
133
138
  buffer_size: int = BUFFER_SIZE,
134
139
  sample_rate: int = SAMPLE_RATE,
135
140
  initial_prompt: Optional[Union[str, Iterable[int]]] = None,
141
+ initial_prompt_realtime: Optional[Union[str, Iterable[int]]] = None,
136
142
  suppress_tokens: Optional[List[int]] = [-1],
137
143
  print_transcription_time: bool = False,
138
144
  early_transcription_on_silence: int = 0,
@@ -162,10 +168,14 @@ class AudioToTextRecorderClient:
162
168
  self.use_microphone = use_microphone
163
169
  self.spinner = spinner
164
170
  self.level = level
171
+ self.batch_size = batch_size
172
+ self.init_realtime_after_seconds = init_realtime_after_seconds
173
+ self.realtime_batch_size = realtime_batch_size
165
174
 
166
175
  # Real-time transcription parameters
167
176
  self.enable_realtime_transcription = enable_realtime_transcription
168
177
  self.use_main_model_for_realtime = use_main_model_for_realtime
178
+ self.download_root = download_root
169
179
  self.realtime_model_type = realtime_model_type
170
180
  self.realtime_processing_pause = realtime_processing_pause
171
181
  self.on_realtime_transcription_update = on_realtime_transcription_update
@@ -204,6 +214,7 @@ class AudioToTextRecorderClient:
204
214
  self.buffer_size = buffer_size
205
215
  self.sample_rate = sample_rate
206
216
  self.initial_prompt = initial_prompt
217
+ self.initial_prompt_realtime = initial_prompt_realtime
207
218
  self.suppress_tokens = suppress_tokens
208
219
  self.print_transcription_time = print_transcription_time
209
220
  self.early_transcription_on_silence = early_transcription_on_silence
@@ -376,6 +387,43 @@ class AudioToTextRecorderClient:
376
387
  args += ['--model', self.model]
377
388
  if self.realtime_model_type:
378
389
  args += ['--realtime_model_type', self.realtime_model_type]
390
+ if self.download_root:
391
+ args += ['--root', self.download_root]
392
+ if self.batch_size is not None:
393
+ args += ['--batch', str(self.batch_size)]
394
+ if self.realtime_batch_size is not None:
395
+ args += ['--realtime_batch_size', str(self.realtime_batch_size)]
396
+ if self.init_realtime_after_seconds is not None:
397
+ args += ['--init_realtime_after_seconds', str(self.init_realtime_after_seconds)]
398
+ if self.initial_prompt_realtime:
399
+ sanitized_prompt = self.initial_prompt_realtime.replace("\n", "\\n")
400
+ args += ['--initial_prompt_realtime', sanitized_prompt]
401
+
402
+ # if self.compute_type:
403
+ # args += ['--compute_type', self.compute_type]
404
+ # if self.input_device_index is not None:
405
+ # args += ['--input_device_index', str(self.input_device_index)]
406
+ # if self.gpu_device_index is not None:
407
+ # args += ['--gpu_device_index', str(self.gpu_device_index)]
408
+ # if self.device:
409
+ # args += ['--device', self.device]
410
+ # if self.spinner:
411
+ # args.append('--spinner') # flag, no need for True/False
412
+ # if self.enable_realtime_transcription:
413
+ # args.append('--enable_realtime_transcription') # flag, no need for True/False
414
+ # if self.handle_buffer_overflow:
415
+ # args.append('--handle_buffer_overflow') # flag, no need for True/False
416
+ # if self.suppress_tokens:
417
+ # args += ['--suppress_tokens', str(self.suppress_tokens)]
418
+ # if self.print_transcription_time:
419
+ # args.append('--print_transcription_time') # flag, no need for True/False
420
+ # if self.allowed_latency_limit is not None:
421
+ # args += ['--allowed_latency_limit', str(self.allowed_latency_limit)]
422
+ # if self.no_log_file:
423
+ # args.append('--no_log_file') # flag, no need for True
424
+ # if self.debug_mode:
425
+ # args.append('--debug') # flag, no need for True/False
426
+
379
427
  if self.language:
380
428
  args += ['--language', self.language]
381
429
  if self.silero_sensitivity is not None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: RealtimeSTT
3
- Version: 0.3.91
3
+ Version: 0.3.93
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
@@ -13,7 +13,7 @@ Requires-Python: >=3.6
13
13
  Description-Content-Type: text/markdown
14
14
  License-File: LICENSE
15
15
  Requires-Dist: PyAudio==0.2.14
16
- Requires-Dist: faster-whisper==1.0.3
16
+ Requires-Dist: faster-whisper==1.1.0
17
17
  Requires-Dist: pvporcupine==1.9.5
18
18
  Requires-Dist: webrtcvad-wheels==2.0.14
19
19
  Requires-Dist: halo==0.0.31
@@ -21,7 +21,7 @@ Requires-Dist: torch
21
21
  Requires-Dist: torchaudio
22
22
  Requires-Dist: scipy==1.14.1
23
23
  Requires-Dist: openwakeword>=0.4.0
24
- Requires-Dist: websockets==v12.0
24
+ Requires-Dist: websockets==14.1
25
25
  Requires-Dist: websocket-client==1.8.0
26
26
  Requires-Dist: numpy<2.0.0
27
27
 
@@ -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.9
58
+ Latest Version: v0.3.92
59
59
 
60
60
  See [release history](https://github.com/KoljaB/RealtimeSTT/releases).
61
61
 
@@ -136,6 +136,8 @@ Although it is possible to run RealtimeSTT with a CPU installation only (use a s
136
136
  Before installing RealtimeSTT please execute:
137
137
 
138
138
  ```bash
139
+ sudo apt-get update
140
+ sudo apt-get install python3-dev
139
141
  sudo apt-get install portaudio19-dev
140
142
  ```
141
143
 
@@ -1,5 +1,5 @@
1
1
  PyAudio==0.2.14
2
- faster-whisper==1.0.3
2
+ faster-whisper==1.1.0
3
3
  pvporcupine==1.9.5
4
4
  webrtcvad-wheels==2.0.14
5
5
  halo==0.0.31
@@ -7,6 +7,6 @@ torch
7
7
  torchaudio
8
8
  scipy==1.14.1
9
9
  openwakeword>=0.4.0
10
- websockets==v12.0
10
+ websockets==14.1
11
11
  websocket-client==1.8.0
12
12
  numpy<2.0.0
@@ -27,6 +27,8 @@ stt-server [OPTIONS]
27
27
  - `-D, --debug`: Enable debug logging.
28
28
  - `-W, --write`: Save audio to WAV file.
29
29
  - `-s, --silence_timing`: Enable dynamic silence duration for sentence detection; default True.
30
+ - `-b, --batch, --batch_size`: Batch size for inference; default 16.
31
+ - `--root, --download_root`: Specifies the root path were the Whisper models are downloaded to.
30
32
  - `--silero_sensitivity`: Silero VAD sensitivity (0-1); default 0.05.
31
33
  - `--silero_use_onnx`: Use Silero ONNX model; default False.
32
34
  - `--webrtc_sensitivity`: WebRTC VAD sensitivity (0-3); default 3.
@@ -38,7 +40,10 @@ stt-server [OPTIONS]
38
40
  - `--early_transcription_on_silence`: Start transcription after silence in seconds; default 0.2.
39
41
  - `--beam_size`: Beam size for main model; default 5.
40
42
  - `--beam_size_realtime`: Beam size for real-time model; default 3.
41
- - `--initial_prompt`: Initial transcription guidance prompt.
43
+ - `--init_realtime_after_seconds`: Initial waiting time for realtime transcription; default 0.2.
44
+ - `--realtime_batch_size`: Batch size for the real-time transcription model; default 16.
45
+ - `--initial_prompt`: Initial main transcription guidance prompt.
46
+ - `--initial_prompt_realtime`: Initial realtime transcription guidance prompt.
42
47
  - `--end_of_sentence_detection_pause`: Silence duration for sentence end detection; default 0.45.
43
48
  - `--unknown_sentence_detection_pause`: Pause duration for incomplete sentence detection; default 0.7.
44
49
  - `--mid_sentence_detection_pause`: Pause for mid-sentence break; default 2.0.
@@ -52,6 +57,14 @@ stt-server [OPTIONS]
52
57
  - `--use_main_model_for_realtime`: Use main model for real-time transcription.
53
58
  - `--use_extended_logging`: Enable extensive log messages.
54
59
  - `--logchunks`: Log incoming audio chunks.
60
+ - `--compute_type`: Type of computation to use.
61
+ - `--input_device_index`: Index of the audio input device.
62
+ - `--gpu_device_index`: Index of the GPU device.
63
+ - `--device`: Device to use for computation.
64
+ - `--handle_buffer_overflow`: Handle buffer overflow during transcription.
65
+ - `--suppress_tokens`: Suppress tokens during transcription.
66
+ - `--allowed_latency_limit`: Allowed latency limit for real-time transcription.
67
+
55
68
 
56
69
  ### WebSocket Interface:
57
70
  The server supports two WebSocket connections:
@@ -364,7 +377,7 @@ def parse_arguments():
364
377
  parser.add_argument('-l', '--lang', '--language', type=str, default='en',
365
378
  help='Language code for the STT model to transcribe in a specific language. Leave this empty for auto-detection based on input audio. Default is en. List of supported language codes: https://github.com/openai/whisper/blob/main/whisper/tokenizer.py#L11-L110')
366
379
 
367
- parser.add_argument('-i', '--input-device', '--input_device_index', type=int, default=1,
380
+ parser.add_argument('-i', '--input-device', '--input-device-index', type=int, default=1,
368
381
  help='Index of the audio input device to use. Use this option to specify a particular microphone or audio input device based on your system. Default is 1.')
369
382
 
370
383
  parser.add_argument('-c', '--control', '--control_port', type=int, default=8011,
@@ -378,12 +391,23 @@ def parse_arguments():
378
391
 
379
392
  parser.add_argument('-D', '--debug', action='store_true', help='Enable debug logging for detailed server operations')
380
393
 
381
- parser.add_argument("-W", "--write", metavar="FILE",
382
- help="Save received audio to a WAV file")
394
+ parser.add_argument('-W', '--write', metavar='FILE', help='Save received audio to a WAV file')
395
+
396
+ parser.add_argument('-b', '--batch', '--batch_size', type=int, default=16, help='Batch size for inference. This parameter controls the number of audio chunks processed in parallel during transcription. Default is 16.')
397
+
398
+ parser.add_argument('--root', '--download_root', type=str,default=None, help='Specifies the root path where the Whisper models are downloaded to. Default is None.')
383
399
 
384
400
  parser.add_argument('-s', '--silence_timing', action='store_true', default=True,
385
401
  help='Enable dynamic adjustment of silence duration for sentence detection. Adjusts post-speech silence duration based on detected sentence structure and punctuation. Default is False.')
386
402
 
403
+ parser.add_argument('--init_realtime_after_seconds', type=float, default=0.2,
404
+ help='The initial waiting time in seconds before real-time transcription starts. This delay helps prevent false positives at the beginning of a session. Default is 0.2 seconds.')
405
+
406
+ parser.add_argument('--realtime_batch_size', type=int, default=16,
407
+ help='Batch size for the real-time transcription model. This parameter controls the number of audio chunks processed in parallel during real-time transcription. Default is 16.')
408
+
409
+ parser.add_argument('--initial_prompt_realtime', type=str, default="", help='Initial prompt that guides the real-time transcription model to produce transcriptions in a particular style or format.')
410
+
387
411
  parser.add_argument('--silero_sensitivity', type=float, default=0.05,
388
412
  help='Sensitivity level for Silero Voice Activity Detection (VAD), with a range from 0 to 1. Lower values make the model less sensitive, useful for noisy environments. Default is 0.05.')
389
413
 
@@ -457,6 +481,23 @@ def parse_arguments():
457
481
  parser.add_argument('--use_extended_logging', action='store_true',
458
482
  help='Writes extensive log messages for the recording worker, that processes the audio chunks.')
459
483
 
484
+ parser.add_argument('--compute_type', type=str, default='default',
485
+ help='Type of computation to use. See https://opennmt.net/CTranslate2/quantization.html')
486
+
487
+ parser.add_argument('--gpu_device_index', type=int, default=0,
488
+ help='Index of the GPU device to use. Default is None.')
489
+
490
+ parser.add_argument('--device', type=str, default='cuda',
491
+ help='Device for model to use. Can either be "cuda" or "cpu". Default is cuda.')
492
+
493
+ parser.add_argument('--handle_buffer_overflow', action='store_true',
494
+ help='Handle buffer overflow during transcription. Default is False.')
495
+
496
+ parser.add_argument('--suppress_tokens', type=int, default=[-1], nargs='*', help='Suppress tokens during transcription. Default is [-1].')
497
+
498
+ parser.add_argument('--allowed_latency_limit', type=int, default=100,
499
+ help='Maximal amount of chunks that can be unprocessed in queue before discarding chunks.. Default is 100.')
500
+
460
501
  parser.add_argument('--logchunks', action='store_true', help='Enable logging of incoming audio chunks (periods)')
461
502
 
462
503
  # Parse arguments
@@ -479,6 +520,9 @@ def parse_arguments():
479
520
  if args.initial_prompt:
480
521
  args.initial_prompt = args.initial_prompt.replace("\\n", "\n")
481
522
 
523
+ if args.initial_prompt_realtime:
524
+ args.initial_prompt_realtime = args.initial_prompt_realtime.replace("\\n", "\n")
525
+
482
526
  return args
483
527
 
484
528
  def _recorder_thread(loop):
@@ -534,7 +578,7 @@ def decode_and_resample(
534
578
 
535
579
  return resampled_audio.astype(np.int16).tobytes()
536
580
 
537
- async def control_handler(websocket, path):
581
+ async def control_handler(websocket):
538
582
  debug_print(f"New control connection from {websocket.remote_address}")
539
583
  print(f"{bcolors.OKGREEN}Control client connected{bcolors.ENDC}")
540
584
  global recorder
@@ -629,7 +673,7 @@ async def control_handler(websocket, path):
629
673
  finally:
630
674
  control_connections.remove(websocket)
631
675
 
632
- async def data_handler(websocket, path):
676
+ async def data_handler(websocket):
633
677
  global writechunks, wav_file
634
678
  print(f"{bcolors.OKGREEN}Data client connected{bcolors.ENDC}")
635
679
  data_connections.add(websocket)
@@ -700,8 +744,13 @@ async def main_async():
700
744
 
701
745
  recorder_config = {
702
746
  'model': args.model,
747
+ 'download_root': args.root,
703
748
  'realtime_model_type': args.rt_model,
704
749
  'language': args.lang,
750
+ 'batch_size': args.batch,
751
+ 'init_realtime_after_seconds': args.init_realtime_after_seconds,
752
+ 'realtime_batch_size': args.realtime_batch_size,
753
+ 'initial_prompt_realtime': args.initial_prompt_realtime,
705
754
  'input_device_index': args.input_device,
706
755
  'silero_sensitivity': args.silero_sensitivity,
707
756
  'silero_use_onnx': args.silero_use_onnx,
@@ -740,6 +789,12 @@ async def main_async():
740
789
  'no_log_file': True, # Disable logging to file
741
790
  'use_extended_logging': args.use_extended_logging,
742
791
  'level': loglevel,
792
+ 'compute_type': args.compute_type,
793
+ 'gpu_device_index': args.gpu_device_index,
794
+ 'device': args.device,
795
+ 'handle_buffer_overflow': args.handle_buffer_overflow,
796
+ 'suppress_tokens': args.suppress_tokens,
797
+ 'allowed_latency_limit': args.allowed_latency_limit,
743
798
  }
744
799
 
745
800
  try:
@@ -9,7 +9,7 @@ with open('requirements.txt') as f:
9
9
 
10
10
  setuptools.setup(
11
11
  name="RealtimeSTT",
12
- version="0.3.91",
12
+ version="0.3.93",
13
13
  author="Kolja Beigel",
14
14
  author_email="kolja.beigel@web.de",
15
15
  description="A fast Voice Activity Detection and Transcription System",
File without changes
File without changes