fix: allow Whisper to generate more tokens based on audio length

Before, it sometimes cut off the transcription too early.

ref: N25B-209
This commit is contained in:
Twirre Meulenbelt
2025-11-05 10:41:11 +01:00
parent 8e4d8f9d1e
commit 5c228df109
2 changed files with 16 additions and 5 deletions

View File

@@ -59,6 +59,10 @@ class TranscriptionAgent(Agent):
audio = await self.audio_in_socket.recv()
audio = np.frombuffer(audio, dtype=np.float32)
speech = await self._transcribe(audio)
if not speech:
logger.info("Nothing transcribed.")
return
logger.info("Transcribed speech: %s", speech)
await self._share_transcription(speech)