diff --git a/wyoming_whisper_api_client/handler.py b/wyoming_whisper_api_client/handler.py index 61a8965..efbbdf8 100644 --- a/wyoming_whisper_api_client/handler.py +++ b/wyoming_whisper_api_client/handler.py @@ -3,6 +3,7 @@ import httpx import logging import wave +import re from io import BytesIO @@ -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())