This commit is contained in:
2026-05-25 22:50:09 -07:00
parent 685586318f
commit 60e170e777
14 changed files with 56 additions and 27 deletions
Binary file not shown.
Binary file not shown.
+3
View File
@@ -41,6 +41,9 @@ class AudioListener:
target_samples = int(self.sample_rate * self.chunk_duration)
chunk = chunk[:target_samples]
# Flatten to 1D array (samples,) as expected by faster-whisper
chunk = chunk.flatten()
# Use call_soon_threadsafe to put the chunk into the asyncio queue from the callback thread
self.loop.call_soon_threadsafe(self.audio_queue.put_nowait, chunk)
self._buffer = []
+2 -2
View File
@@ -46,8 +46,8 @@ class Transcriber:
return ""
try:
# faster-whisper expects audio in float32
audio_data = audio_chunk.astype("float32")
# faster-whisper expects audio in float32 and 1D array
audio_data = audio_chunk.astype("float32").flatten()
# Transcribe the audio
segments, info = self.model.transcribe(audio_data, beam_size=5)