wyoming-microsoft-stt 1.3.4__py3-none-any.whl → 1.3.6__py3-none-any.whl

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.
@@ -25,6 +25,7 @@ def handle_stop_signal(*args):
25
25
  """Handle shutdown signal and set the stop event."""
26
26
  _LOGGER.info("Received stop signal. Shutting down...")
27
27
  stop_event.set()
28
+ exit()
28
29
 
29
30
 
30
31
  def parse_arguments():
@@ -17,7 +17,7 @@ class MicrosoftSTT:
17
17
 
18
18
  self._stream: speechsdk.audio.PushAudioInputStream | None = None
19
19
  self._speech_recognizer: speechsdk.SpeechRecognizer | None = None
20
- self._results: list[speechsdk.SpeechRecognitionResult] = []
20
+ self._results: speechsdk.SpeechRecognitionResult | None = None
21
21
 
22
22
  try:
23
23
  # Initialize the speech configuration with the provided subscription key and region
@@ -85,11 +85,12 @@ class MicrosoftSTT:
85
85
  _LOGGER.debug(f"{event.result}")
86
86
  self._results = event.result
87
87
 
88
- self._speech_recognizer.start_continuous_recognition()
89
88
  self._speech_recognizer.recognized.connect(recognized)
89
+ self._speech_recognizer.start_continuous_recognition_async()
90
90
 
91
91
  def push_audio_chunk(self, chunk: bytes) -> None:
92
92
  """Push an audio chunk to the recognizer."""
93
+ _LOGGER.debug(f"Pushing audio chunk of size {len(chunk)} bytes...")
93
94
  self._stream.write(chunk)
94
95
 
95
96
  def stop_audio_chunk(self) -> None:
@@ -106,7 +107,15 @@ class MicrosoftSTT:
106
107
  while not self.recognition_done:
107
108
  time.sleep(0.01)
108
109
 
109
- self._speech_recognizer.stop_continuous_recognition()
110
+ out_future = self._speech_recognizer.stop_continuous_recognition_async()
111
+
112
+ out = out_future.get()
113
+
114
+ _LOGGER.debug(f"Transcription stopped, result: {out}")
115
+
116
+ if self._results is None:
117
+ _LOGGER.debug("No results from transcription.")
118
+ return ""
110
119
 
111
120
  return self._results.text
112
121
 
@@ -114,7 +123,7 @@ class MicrosoftSTT:
114
123
  _LOGGER.error(f"Failed to transcribe audio: {e}")
115
124
  return ""
116
125
 
117
- def get_language(self, language: str) -> dict:
126
+ def get_language(self, language: None | str) -> dict:
118
127
  """Get the language code."""
119
128
  if len(self.args.language) > 1:
120
129
  auto_detect_source_language_config = (
@@ -1,3 +1,3 @@
1
1
  """Version information."""
2
2
 
3
- __version__ = "1.3.4"
3
+ __version__ = "1.3.6"
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wyoming-microsoft-stt
3
- Version: 1.3.4
3
+ Version: 1.3.6
4
4
  Summary: Add your description here
5
5
  Home-page: https://github.com/hugobloem/wyoming-microsoft-stt
6
6
  Author: Hugo Bloem
7
7
  Author-email:
8
8
  Requires-Python: >=3.13
9
9
  Description-Content-Type: text/markdown
10
- Requires-Dist: azure-cognitiveservices-speech>=1.45.0
10
+ Requires-Dist: azure-cognitiveservices-speech>=1.46.0
11
11
  Requires-Dist: pydantic>=2.11.7
12
12
  Requires-Dist: wyoming>=1.7.2
13
13
  Dynamic: author
@@ -4,13 +4,13 @@ tests/test_microsoft_stt.py,sha256=CO6xyLHFcE1kqJ_XuGprRu0i28zTN2oHaKtomK_aJIU,5
4
4
  tests/test_multilanguage.py,sha256=wRtyWuhWBmA5Yf01JNbmgxqoVKmDcE6XHz9QcfSR700,3100
5
5
  tests/test_transcribe.py,sha256=qRxpUO94YQSSdlurupCec4D1KNxHrdb9jb_YkITDf-U,3672
6
6
  wyoming_microsoft_stt/__init__.py,sha256=92Kms90cxU6Zs5XjNZiYvIGLA3Yd-BizN-G8f7n506I,3365
7
- wyoming_microsoft_stt/__main__.py,sha256=gA0wM3OCLdEq7ewMRrlWs4TVpXvFlITMaX_4lP3ed7E,5577
7
+ wyoming_microsoft_stt/__main__.py,sha256=QJq8VuIdr1bz9v3kYPnUF6gQqcyh7EJYrJWeMzJ7QJE,5588
8
8
  wyoming_microsoft_stt/download.py,sha256=mTWZl9kVaE7KGeO2d0SS7wztDN6tGo9AudXWhN8uKhg,3379
9
9
  wyoming_microsoft_stt/handler.py,sha256=dWm9etFANRU33IDU-p85enHmWtMtTtW522I3AJbTAxg,3330
10
10
  wyoming_microsoft_stt/languages.json,sha256=eDZuPJLzDjdZlh0I4081OTkLPt6nZdUY8ra45c7oMCc,1881
11
- wyoming_microsoft_stt/microsoft_stt.py,sha256=2Rb9uoOxGFpQfwXux5p3jwop_3poF-75U_84q5QRmt0,5357
12
- wyoming_microsoft_stt/version.py,sha256=OFuvfl5cfUQDN93VNNbFNgAchzEtmOOapeR2eOSZtr0,50
13
- wyoming_microsoft_stt-1.3.4.dist-info/METADATA,sha256=bvV-eQBZ1NedSnfH7ND4v6aYPyyryhfsSbSNh47u5ew,5792
14
- wyoming_microsoft_stt-1.3.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
15
- wyoming_microsoft_stt-1.3.4.dist-info/top_level.txt,sha256=aURyYXybYBAybkVTs2RFT5ctnPz5pRa_B7Gn9_SKhL8,28
16
- wyoming_microsoft_stt-1.3.4.dist-info/RECORD,,
11
+ wyoming_microsoft_stt/microsoft_stt.py,sha256=d_qVOdPGaB_FP9pC1ToPgaZx7T6ao-Y2GESx_Ez9Ijc,5701
12
+ wyoming_microsoft_stt/version.py,sha256=5o54wF7wvZLtN1uPNO9aUw13VGHmyiROmJtdmNgoJPk,50
13
+ wyoming_microsoft_stt-1.3.6.dist-info/METADATA,sha256=Vhjm2F-oXvHGDBEf9m5utzdltwJPFIskzzs-Hd-FlmQ,5792
14
+ wyoming_microsoft_stt-1.3.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
15
+ wyoming_microsoft_stt-1.3.6.dist-info/top_level.txt,sha256=aURyYXybYBAybkVTs2RFT5ctnPz5pRa_B7Gn9_SKhL8,28
16
+ wyoming_microsoft_stt-1.3.6.dist-info/RECORD,,