Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions wyoming_whisper_api_client/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import httpx
import logging
import wave
import re

from io import BytesIO

Expand Down Expand Up @@ -67,6 +68,9 @@ async def handle_event(self, event: Event) -> bool:
#_LOGGER.debug(r.json())
text = r.json()['text']

text = re.sub(r'\[.*?\]', '', text).strip()
text = re.sub(r'\(.*?\)', '', text).strip()

_LOGGER.info(text)

await self.write_event(Transcript(text=text).event())
Expand Down