reddit-video-bot/src/voice_gen.py
sylyx c5f724bac4 Add FastAPI web dashboard with live logs and video gallery
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>
2026-05-16 10:41:42 +02:00

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))