RealTimeSTT 0.2.2__tar.gz → 0.2.3__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.2.2
3
+ Version: 0.2.3
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
@@ -12,6 +12,16 @@ Classifier: Operating System :: OS Independent
12
12
  Requires-Python: >=3.6
13
13
  Description-Content-Type: text/markdown
14
14
  License-File: LICENSE
15
+ Requires-Dist: PyAudio==0.2.14
16
+ Requires-Dist: faster-whisper==1.0.3
17
+ Requires-Dist: pvporcupine==1.9.5
18
+ Requires-Dist: webrtcvad==2.0.10
19
+ Requires-Dist: halo==0.0.31
20
+ Requires-Dist: torch==2.3.1
21
+ Requires-Dist: torchaudio==2.3.1
22
+ Requires-Dist: scipy==1.12.0
23
+ Requires-Dist: websockets==v12.0
24
+ Requires-Dist: openwakeword==0.6.0
15
25
 
16
26
 
17
27
  # RealtimeSTT
@@ -229,7 +229,7 @@ class AudioToTextRecorder:
229
229
  pre-trained model from Silero in the ONNX (Open Neural Network
230
230
  Exchange) format instead of the PyTorch format. This is
231
231
  recommended for faster performance.
232
- - silero_deactivity_detection (bool, default=False): Enables the Silero
232
+ - silero_deactivity_detection (bool, default=False): Enables the Silero
233
233
  model for end-of-speech detection. More robust against background
234
234
  noise. Utilizes additional GPU resources but improves accuracy in
235
235
  noisy environments. When False, uses the default WebRTC VAD,
@@ -410,6 +410,10 @@ class AudioToTextRecorder:
410
410
  self.initial_prompt = initial_prompt
411
411
  self.suppress_tokens = suppress_tokens
412
412
  self.use_wake_words = wake_words or wakeword_backend in {'oww', 'openwakeword', 'openwakewords'}
413
+ self.detected_language = None
414
+ self.detected_language_probability = 0
415
+ self.detected_realtime_language = None
416
+ self.detected_realtime_language_probability = 0
413
417
 
414
418
  # Initialize the logging configuration with the specified level
415
419
  log_format = 'RealTimeSTT: %(name)s - %(levelname)s - %(message)s'
@@ -758,17 +762,16 @@ class AudioToTextRecorder:
758
762
  if conn.poll(0.5):
759
763
  audio, language = conn.recv()
760
764
  try:
761
- segments = model.transcribe(
765
+ segments, info = model.transcribe(
762
766
  audio,
763
767
  language=language if language else None,
764
768
  beam_size=beam_size,
765
769
  initial_prompt=initial_prompt,
766
770
  suppress_tokens=suppress_tokens
767
771
  )
768
- segments = segments[0]
769
772
  transcription = " ".join(seg.text for seg in segments)
770
773
  transcription = transcription.strip()
771
- conn.send(('success', transcription))
774
+ conn.send(('success', (transcription, info)))
772
775
  except Exception as e:
773
776
  logging.error(f"General transcription error: {e}")
774
777
  conn.send(('error', str(e)))
@@ -969,8 +972,11 @@ class AudioToTextRecorder:
969
972
 
970
973
  self._set_state("inactive")
971
974
  if status == 'success':
975
+ segments, info = result
976
+ self.detected_language = info.language if info.language_probability > 0 else None
977
+ self.detected_language_probability = info.language_probability
972
978
  self.last_transcription_bytes = audio_copy
973
- return self._preprocess_output(result)
979
+ return self._preprocess_output(segments)
974
980
  else:
975
981
  logging.error(result)
976
982
  raise Exception(result)
@@ -1447,7 +1453,7 @@ class AudioToTextRecorder:
1447
1453
  INT16_MAX_ABS_VALUE
1448
1454
 
1449
1455
  # Perform transcription and assemble the text
1450
- segments = self.realtime_model_type.transcribe(
1456
+ segments, info = self.realtime_model_type.transcribe(
1451
1457
  audio_array,
1452
1458
  language=self.language if self.language else None,
1453
1459
  beam_size=self.beam_size_realtime,
@@ -1455,6 +1461,9 @@ class AudioToTextRecorder:
1455
1461
  suppress_tokens=self.suppress_tokens,
1456
1462
  )
1457
1463
 
1464
+ self.detected_realtime_language = info.language if info.language_probability > 0 else None
1465
+ self.detected_realtime_language_probability = info.language_probability
1466
+
1458
1467
  # double check recording state
1459
1468
  # because it could have changed mid-transcription
1460
1469
  if self.is_recording and time.time() - \
@@ -1462,7 +1471,7 @@ class AudioToTextRecorder:
1462
1471
 
1463
1472
  logging.debug('Starting realtime transcription')
1464
1473
  self.realtime_transcription_text = " ".join(
1465
- seg.text for seg in segments[0]
1474
+ seg.text for seg in segments
1466
1475
  )
1467
1476
  self.realtime_transcription_text = \
1468
1477
  self.realtime_transcription_text.strip()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: RealtimeSTT
3
- Version: 0.2.2
3
+ Version: 0.2.3
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
@@ -12,6 +12,16 @@ Classifier: Operating System :: OS Independent
12
12
  Requires-Python: >=3.6
13
13
  Description-Content-Type: text/markdown
14
14
  License-File: LICENSE
15
+ Requires-Dist: PyAudio==0.2.14
16
+ Requires-Dist: faster-whisper==1.0.3
17
+ Requires-Dist: pvporcupine==1.9.5
18
+ Requires-Dist: webrtcvad==2.0.10
19
+ Requires-Dist: halo==0.0.31
20
+ Requires-Dist: torch==2.3.1
21
+ Requires-Dist: torchaudio==2.3.1
22
+ Requires-Dist: scipy==1.12.0
23
+ Requires-Dist: websockets==v12.0
24
+ Requires-Dist: openwakeword==0.6.0
15
25
 
16
26
 
17
27
  # RealtimeSTT
@@ -9,7 +9,7 @@ with open('requirements.txt') as f:
9
9
 
10
10
  setuptools.setup(
11
11
  name="RealtimeSTT",
12
- version="0.2.2",
12
+ version="0.2.3",
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
File without changes