#!/usr/bin/env python3 """Quentin narration for the Runpod ComfyUI tutorial. Key from Bitwarden Secrets Manager, never printed. tools/tts.py lines.json out_dir # lines.json: [{"id", "text", "prev"?, "next"?, "speed"?}, ...] Each line gives out_dir/.mp3 and out_dir/.words.json with word timings. Existing takes are kept, so a rerun only pays for new or changed lines. SPOKEN holds the only differences between what the script says and what the voice is told to read, because the frozen script stays word for word on screen. """ import base64, hashlib, json, os, re, subprocess, sys, urllib.request VOICE_ID = "cjVigY5qzO86Huf0OWal" # Eric - Smooth, Trustworthy; the owner chose him November 1, 2026 MODEL = "eleven_multilingual_v2" SETTINGS = {"stability": 0.5, "similarity_boost": 0.75} SECRET_ID = "82f9689b-1a23-4472-91c6-b4be017b23e9" # AGENT_ELEVENLABS_API_KEY SPOKEN = [ ("Use @Browser", "Use the at symbol with Browser"), ("Use @Chrome", "Use the at symbol with Chrome"), ("Then mention @Computer", "Then type the at symbol, then Computer,"), ("airesourcepro.com", "A I Resource Pro dot com"), ("MCP", "M C P"), ("AGENTS.md", "agents dot M D"), ("PreToolUse", "pre tool use"), ("chrome://extensions", "chrome colon slash slash extensions"), ("IDE", "I D E"), ("IDEs", "I D Es"), ("CLI", "C L I"), ("macOS", "Mac O S"), ] def spoken(text): for written, said in SPOKEN: text = re.sub(rf"(?