Dark industrial-themed UI with WebSocket log streaming, bot trigger button, settings panel (subreddits, Whisper model, TTS voice, thresholds), and video gallery with inline player. Settings are passed to the bot subprocess via env vars so the pipeline respects UI config at runtime. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
14 lines
372 B
Python
14 lines
372 B
Python
import asyncio
|
|
import os
|
|
import edge_tts
|
|
|
|
|
|
async def _synthesize(text: str, output_path: str, voice: str):
|
|
communicate = edge_tts.Communicate(text, voice)
|
|
await communicate.save(output_path)
|
|
|
|
|
|
def generate_audio(text: str, output_path: str):
|
|
voice = os.environ.get("BOT_VOICE", "en-US-ChristopherNeural")
|
|
asyncio.run(_synthesize(text, output_path, voice))
|