From d135265798da8c2698f363237f4cb74b682f3f9e Mon Sep 17 00:00:00 2001 From: salmonik Date: Fri, 17 Apr 2026 15:36:12 +0200 Subject: make voice great again Signed-off-by: salmonik --- cogs/tts.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'cogs/tts.py') diff --git a/cogs/tts.py b/cogs/tts.py index 5e6945c..65f1fce 100644 --- a/cogs/tts.py +++ b/cogs/tts.py @@ -94,7 +94,8 @@ class TTS(commands.Cog): try: # Generate and save TTS to temp file tts = gTTS(text=text, lang='pl') - tts.save(temp_path) + loop = asyncio.get_event_loop() + await loop.run_in_executor(None, tts.save, temp_path) # Load settings volume = get_volume() @@ -104,7 +105,10 @@ class TTS(commands.Cog): await self._handle_file_output(ctx, temp_path, text) elif output == "vc": await self._handle_voice_output(ctx, temp_path, text, volume) - + + except Exception as e: + logger.error(f"TTS generation error: {e}") + await ctx.respond("Error generating TTS", ephemeral=True) finally: await self._cleanup_temp_file(temp_path) -- cgit v1.2.3