RealTimeSTT 0.3.94__tar.gz → 0.3.95__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.94 → realtimestt-0.3.95}/PKG-INFO +4 -4
- {realtimestt-0.3.94 → realtimestt-0.3.95}/README.md +2 -3
- {realtimestt-0.3.94 → realtimestt-0.3.95}/RealtimeSTT/audio_recorder.py +36 -14
- realtimestt-0.3.95/RealtimeSTT/warmup_audio.wav +0 -0
- {realtimestt-0.3.94 → realtimestt-0.3.95}/RealtimeSTT.egg-info/PKG-INFO +4 -4
- {realtimestt-0.3.94 → realtimestt-0.3.95}/RealtimeSTT.egg-info/SOURCES.txt +1 -0
- {realtimestt-0.3.94 → realtimestt-0.3.95}/RealtimeSTT.egg-info/requires.txt +1 -0
- {realtimestt-0.3.94 → realtimestt-0.3.95}/setup.py +3 -1
- {realtimestt-0.3.94 → realtimestt-0.3.95}/LICENSE +0 -0
- {realtimestt-0.3.94 → realtimestt-0.3.95}/RealtimeSTT/__init__.py +0 -0
- {realtimestt-0.3.94 → realtimestt-0.3.95}/RealtimeSTT/audio_input.py +0 -0
- {realtimestt-0.3.94 → realtimestt-0.3.95}/RealtimeSTT/audio_recorder_client.py +0 -0
- {realtimestt-0.3.94 → realtimestt-0.3.95}/RealtimeSTT.egg-info/dependency_links.txt +0 -0
- {realtimestt-0.3.94 → realtimestt-0.3.95}/RealtimeSTT.egg-info/entry_points.txt +0 -0
- {realtimestt-0.3.94 → realtimestt-0.3.95}/RealtimeSTT.egg-info/top_level.txt +0 -0
- {realtimestt-0.3.94 → realtimestt-0.3.95}/RealtimeSTT_server/__init__.py +0 -0
- {realtimestt-0.3.94 → realtimestt-0.3.95}/RealtimeSTT_server/install_packages.py +0 -0
- {realtimestt-0.3.94 → realtimestt-0.3.95}/RealtimeSTT_server/stt_cli_client.py +0 -0
- {realtimestt-0.3.94 → realtimestt-0.3.95}/RealtimeSTT_server/stt_server.py +0 -0
- {realtimestt-0.3.94 → realtimestt-0.3.95}/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.95
|
|
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
|
|
@@ -24,10 +24,11 @@ Requires-Dist: openwakeword>=0.4.0
|
|
|
24
24
|
Requires-Dist: websockets==14.2
|
|
25
25
|
Requires-Dist: websocket-client==1.8.0
|
|
26
26
|
Requires-Dist: numpy<2.0.0
|
|
27
|
+
Requires-Dist: soundfile==0.13.1
|
|
27
28
|
|
|
28
29
|
# RealtimeSTT
|
|
29
30
|
[](https://pypi.org/project/RealtimeSTT/)
|
|
30
|
-
[](https://pepy.tech/
|
|
31
|
+
[](https://www.pepy.tech/projects/realtimestt)
|
|
31
32
|
[](https://GitHub.com/KoljaB/RealtimeSTT/releases/)
|
|
32
33
|
[](https://GitHub.com/Naereen/KoljaB/RealtimeSTT/commit/)
|
|
33
34
|
[](https://GitHub.com/KoljaB/RealtimeSTT/network/)
|
|
@@ -55,7 +56,7 @@ https://github.com/user-attachments/assets/797e6552-27cd-41b1-a7f3-e5cbc72094f5
|
|
|
55
56
|
|
|
56
57
|
### Updates
|
|
57
58
|
|
|
58
|
-
Latest Version: v0.3.
|
|
59
|
+
Latest Version: v0.3.95
|
|
59
60
|
|
|
60
61
|
See [release history](https://github.com/KoljaB/RealtimeSTT/releases).
|
|
61
62
|
|
|
@@ -67,7 +68,6 @@ See [release history](https://github.com/KoljaB/RealtimeSTT/releases).
|
|
|
67
68
|
|
|
68
69
|
```python
|
|
69
70
|
from RealtimeSTT import AudioToTextRecorder
|
|
70
|
-
import pyautogui
|
|
71
71
|
|
|
72
72
|
def process_text(text):
|
|
73
73
|
print(text)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# RealtimeSTT
|
|
2
2
|
[](https://pypi.org/project/RealtimeSTT/)
|
|
3
|
-
[](https://pepy.tech/
|
|
3
|
+
[](https://www.pepy.tech/projects/realtimestt)
|
|
4
4
|
[](https://GitHub.com/KoljaB/RealtimeSTT/releases/)
|
|
5
5
|
[](https://GitHub.com/Naereen/KoljaB/RealtimeSTT/commit/)
|
|
6
6
|
[](https://GitHub.com/KoljaB/RealtimeSTT/network/)
|
|
@@ -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.
|
|
31
|
+
Latest Version: v0.3.95
|
|
32
32
|
|
|
33
33
|
See [release history](https://github.com/KoljaB/RealtimeSTT/releases).
|
|
34
34
|
|
|
@@ -40,7 +40,6 @@ See [release history](https://github.com/KoljaB/RealtimeSTT/releases).
|
|
|
40
40
|
|
|
41
41
|
```python
|
|
42
42
|
from RealtimeSTT import AudioToTextRecorder
|
|
43
|
-
import pyautogui
|
|
44
43
|
|
|
45
44
|
def process_text(text):
|
|
46
45
|
print(text)
|
|
@@ -26,15 +26,15 @@ Author: Kolja Beigel
|
|
|
26
26
|
|
|
27
27
|
"""
|
|
28
28
|
|
|
29
|
+
from faster_whisper import WhisperModel, BatchedInferencePipeline
|
|
29
30
|
from typing import Iterable, List, Optional, Union
|
|
30
|
-
import torch.multiprocessing as mp
|
|
31
|
-
import torch
|
|
32
|
-
from ctypes import c_bool
|
|
33
31
|
from openwakeword.model import Model
|
|
32
|
+
import torch.multiprocessing as mp
|
|
34
33
|
from scipy.signal import resample
|
|
35
|
-
from scipy import signal
|
|
36
34
|
import signal as system_signal
|
|
37
|
-
from
|
|
35
|
+
from ctypes import c_bool
|
|
36
|
+
from scipy import signal
|
|
37
|
+
import soundfile as sf
|
|
38
38
|
import faster_whisper
|
|
39
39
|
import openwakeword
|
|
40
40
|
import collections
|
|
@@ -43,14 +43,13 @@ import pvporcupine
|
|
|
43
43
|
import traceback
|
|
44
44
|
import threading
|
|
45
45
|
import webrtcvad
|
|
46
|
-
import itertools
|
|
47
46
|
import datetime
|
|
48
47
|
import platform
|
|
49
|
-
import pyaudio
|
|
50
48
|
import logging
|
|
51
49
|
import struct
|
|
52
50
|
import base64
|
|
53
51
|
import queue
|
|
52
|
+
import torch
|
|
54
53
|
import halo
|
|
55
54
|
import time
|
|
56
55
|
import copy
|
|
@@ -144,8 +143,13 @@ class TranscriptionWorker:
|
|
|
144
143
|
model = BatchedInferencePipeline(model=model)
|
|
145
144
|
|
|
146
145
|
# Run a warm-up transcription
|
|
147
|
-
|
|
148
|
-
|
|
146
|
+
current_dir = os.path.dirname(os.path.realpath(__file__))
|
|
147
|
+
warmup_audio_path = os.path.join(
|
|
148
|
+
current_dir, "warmup_audio.wav"
|
|
149
|
+
)
|
|
150
|
+
warmup_audio_data, _ = sf.read(warmup_audio_path, dtype="float32")
|
|
151
|
+
segments, info = model.transcribe(warmup_audio_data, language="en", beam_size=1)
|
|
152
|
+
model_warmup_transcription = " ".join(segment.text for segment in segments)
|
|
149
153
|
except Exception as e:
|
|
150
154
|
logging.exception(f"Error initializing main faster_whisper transcription model: {e}")
|
|
151
155
|
raise
|
|
@@ -728,8 +732,15 @@ class AudioToTextRecorder:
|
|
|
728
732
|
)
|
|
729
733
|
if self.realtime_batch_size > 0:
|
|
730
734
|
self.realtime_model_type = BatchedInferencePipeline(model=self.realtime_model_type)
|
|
731
|
-
|
|
732
|
-
|
|
735
|
+
|
|
736
|
+
# Run a warm-up transcription
|
|
737
|
+
current_dir = os.path.dirname(os.path.realpath(__file__))
|
|
738
|
+
warmup_audio_path = os.path.join(
|
|
739
|
+
current_dir, "warmup_audio.wav"
|
|
740
|
+
)
|
|
741
|
+
warmup_audio_data, _ = sf.read(warmup_audio_path, dtype="float32")
|
|
742
|
+
segments, info = self.realtime_model_type.transcribe(warmup_audio_data, language="en", beam_size=1)
|
|
743
|
+
model_warmup_transcription = " ".join(segment.text for segment in segments)
|
|
733
744
|
except Exception as e:
|
|
734
745
|
logging.exception("Error initializing faster_whisper "
|
|
735
746
|
f"realtime transcription model: {e}"
|
|
@@ -1265,12 +1276,17 @@ class AudioToTextRecorder:
|
|
|
1265
1276
|
self.listen_start = time.time()
|
|
1266
1277
|
|
|
1267
1278
|
def abort(self):
|
|
1279
|
+
state = self.state
|
|
1268
1280
|
self.start_recording_on_voice_activity = False
|
|
1269
1281
|
self.stop_recording_on_voice_deactivity = False
|
|
1270
|
-
self._set_state("inactive")
|
|
1271
1282
|
self.interrupt_stop_event.set()
|
|
1272
|
-
self.was_interrupted
|
|
1283
|
+
if self.state != "inactive": # if inactive, was_interrupted will never be set
|
|
1284
|
+
self.was_interrupted.wait()
|
|
1285
|
+
self._set_state("transcribing")
|
|
1273
1286
|
self.was_interrupted.clear()
|
|
1287
|
+
if self.is_recording: # if recording, make sure to stop the recorder
|
|
1288
|
+
self.stop()
|
|
1289
|
+
|
|
1274
1290
|
|
|
1275
1291
|
def wait_audio(self):
|
|
1276
1292
|
"""
|
|
@@ -1416,6 +1432,12 @@ class AudioToTextRecorder:
|
|
|
1416
1432
|
|
|
1417
1433
|
while self.transcribe_count > 0:
|
|
1418
1434
|
logging.debug(F"Receive from parent_transcription_pipe after sendiung transcription request, transcribe_count: {self.transcribe_count}")
|
|
1435
|
+
if not self.parent_transcription_pipe.poll(0.1): # check if transcription done
|
|
1436
|
+
if self.interrupt_stop_event.is_set(): # check if interrupted
|
|
1437
|
+
self.was_interrupted.set()
|
|
1438
|
+
self._set_state("inactive")
|
|
1439
|
+
return "" # return empty string if interrupted
|
|
1440
|
+
continue
|
|
1419
1441
|
status, result = self.parent_transcription_pipe.recv()
|
|
1420
1442
|
self.transcribe_count -= 1
|
|
1421
1443
|
|
|
@@ -1436,7 +1458,7 @@ class AudioToTextRecorder:
|
|
|
1436
1458
|
print(f"Model {self.main_model_type} completed transcription in {transcription_time:.2f} seconds")
|
|
1437
1459
|
else:
|
|
1438
1460
|
logging.debug(f"Model {self.main_model_type} completed transcription in {transcription_time:.2f} seconds")
|
|
1439
|
-
return transcription
|
|
1461
|
+
return "" if self.interrupt_stop_event.is_set() else transcription # if interrupted return empty string
|
|
1440
1462
|
else:
|
|
1441
1463
|
logging.error(f"Transcription error: {result}")
|
|
1442
1464
|
raise Exception(result)
|
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: RealtimeSTT
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.95
|
|
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
|
|
@@ -24,10 +24,11 @@ Requires-Dist: openwakeword>=0.4.0
|
|
|
24
24
|
Requires-Dist: websockets==14.2
|
|
25
25
|
Requires-Dist: websocket-client==1.8.0
|
|
26
26
|
Requires-Dist: numpy<2.0.0
|
|
27
|
+
Requires-Dist: soundfile==0.13.1
|
|
27
28
|
|
|
28
29
|
# RealtimeSTT
|
|
29
30
|
[](https://pypi.org/project/RealtimeSTT/)
|
|
30
|
-
[](https://pepy.tech/
|
|
31
|
+
[](https://www.pepy.tech/projects/realtimestt)
|
|
31
32
|
[](https://GitHub.com/KoljaB/RealtimeSTT/releases/)
|
|
32
33
|
[](https://GitHub.com/Naereen/KoljaB/RealtimeSTT/commit/)
|
|
33
34
|
[](https://GitHub.com/KoljaB/RealtimeSTT/network/)
|
|
@@ -55,7 +56,7 @@ https://github.com/user-attachments/assets/797e6552-27cd-41b1-a7f3-e5cbc72094f5
|
|
|
55
56
|
|
|
56
57
|
### Updates
|
|
57
58
|
|
|
58
|
-
Latest Version: v0.3.
|
|
59
|
+
Latest Version: v0.3.95
|
|
59
60
|
|
|
60
61
|
See [release history](https://github.com/KoljaB/RealtimeSTT/releases).
|
|
61
62
|
|
|
@@ -67,7 +68,6 @@ See [release history](https://github.com/KoljaB/RealtimeSTT/releases).
|
|
|
67
68
|
|
|
68
69
|
```python
|
|
69
70
|
from RealtimeSTT import AudioToTextRecorder
|
|
70
|
-
import pyautogui
|
|
71
71
|
|
|
72
72
|
def process_text(text):
|
|
73
73
|
print(text)
|
|
@@ -9,7 +9,7 @@ with open('requirements.txt') as f:
|
|
|
9
9
|
|
|
10
10
|
setuptools.setup(
|
|
11
11
|
name="RealtimeSTT",
|
|
12
|
-
version="0.3.
|
|
12
|
+
version="0.3.95",
|
|
13
13
|
author="Kolja Beigel",
|
|
14
14
|
author_email="kolja.beigel@web.de",
|
|
15
15
|
description="A fast Voice Activity Detection and Transcription System",
|
|
@@ -25,6 +25,8 @@ setuptools.setup(
|
|
|
25
25
|
python_requires='>=3.6',
|
|
26
26
|
install_requires=requirements,
|
|
27
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
|
+
package_data={"RealtimeSTT": ["warmup_audio.wav"]},
|
|
29
|
+
include_package_data=True,
|
|
28
30
|
entry_points={
|
|
29
31
|
'console_scripts': [
|
|
30
32
|
'stt-server=RealtimeSTT_server.stt_server:main',
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|