{
  "updated": "2026-09-22",
  "title": "IndexTTS2 speech workstation and MP4 homepage generator development workflow",
  "humanReadable": {"zh-CN": "/development/", "en": "/en/development/"},
  "stages": [
    {
      "id": "requirements-architecture",
      "name": {"zh-CN": "需求与架构", "en": "Requirements and architecture"},
      "steps": [
        {"operation": "Define the deliverable chain", "input": "script, voice goal, images, publishing need", "output": "voice cloning, speech generation, video composition, QA, and export stages"},
        {"operation": "Select local-first runtimes", "input": "Apple Silicon, sensitive reference media, offline preference", "output": "MLX primary path plus isolated PyTorch/MPS compatibility worker"},
        {"operation": "Define input and output contracts", "input": "model and media requirements", "output": "stable TTS and video job schemas"},
        {"operation": "Define non-functional rules", "input": "memory, cancellation, overwrite, licensing, and usability risks", "output": "observable, recoverable, truthful product behavior"}
      ]
    },
    {
      "id": "tts-workstation",
      "name": {"zh-CN": "IndexTTS2 多模型工作台", "en": "IndexTTS2 multi-model workstation"},
      "keyModules": ["mlx_indextts/webui.py", "generate_v25.py", "generate_omnivoice.py", "generate_voicestudio.py"],
      "steps": [
        {"operation": "Build the Gradio workstation shell", "input": "product contract", "output": "voice library, model controls, job state, preview, and export UI"},
        {"operation": "Integrate IndexTTS 2.5", "input": "text and reference audio", "output": "cached voice conditioning and 22.05 kHz speech"},
        {"operation": "Add duration guards", "input": "generated segment and text-unit estimate", "output": "accepted output or shorter retry"},
        {"operation": "Integrate IndexTTS 2.0 emotion path", "input": "reference, emotion category, strength", "output": "emotion-controlled speech"},
        {"operation": "Integrate OmniVoice MLX", "input": "clone, design, or automatic mode inputs", "output": "24 kHz speech"},
        {"operation": "Align OmniVoice references", "input": "preprocessed reference audio and optional transcript", "output": "matched audio tokens and local-ASR transcript cache"},
        {"operation": "Integrate Fish Audio S2 Pro", "input": "text, tags, optional references and speaker map", "output": "44.1 kHz multi-speaker or cloned speech"},
        {"operation": "Integrate native VoiceStudio OmniVoice", "input": "job manifest", "output": "isolated PyTorch/MPS subprocess result"},
        {"operation": "Isolate model settings and lifecycle", "input": "model switch", "output": "restored current profile and released previous backend"},
        {"operation": "Add chunking and checkpointing", "input": "long script", "output": "safe segments, progress, partial audio, cancellation, and resume support"},
        {"operation": "Normalize and validate audio", "input": "model waveform", "output": "checked WAV, MP3, or FLAC"}
      ]
    },
    {
      "id": "video-generator",
      "name": {"zh-CN": "视频首页 MP4 生成器", "en": "MP4 homepage video generator"},
      "keyModules": ["webui.py", "scripts/make_homepage_bg.py", "scripts/compose_video.py"],
      "steps": [
        {"operation": "Create an asynchronous Flask job", "input": "audio, ordered images, optional text and style", "output": "job_id and persisted pending state"},
        {"operation": "Normalize images", "input": "source images and first-image orientation", "output": "even-dimension homepage and content frames"},
        {"operation": "Build the image timeline", "input": "audio duration and image count", "output": "1 to N to 1 absolute-duration sequence"},
        {"operation": "Parse narration", "input": "optional script", "output": "sentence list or caption-disabled state"},
        {"operation": "Detect pauses", "input": "audio waveform", "output": "candidate sentence boundaries from FFmpeg silencedetect"},
        {"operation": "Render captions", "input": "sentences, timestamps, canvas, style", "output": "transparent timestamped PNG overlays"},
        {"operation": "Compose media", "input": "timeline, overlays, captions, and audio", "output": "faststart H.264/AAC MP4"},
        {"operation": "Fallback encoding", "input": "unavailable hardware encoder", "output": "libx264 ultrafast plus AAC result"},
        {"operation": "Probe and publish result", "input": "final MP4", "output": "duration, dimensions, codecs, preview, download, logs, and history"}
      ]
    },
    {
      "id": "long-form-scale",
      "name": {"zh-CN": "十万字与长视频规模化", "en": "Large-scale audio and long video"},
      "facts": {"singleTtsTaskProtectionCharacters": 100000, "largerProjects": "chapter batches plus model-safe segments and checkpoints", "videoDuration": "audio-driven with no hard-coded editorial minute limit"},
      "steps": [
        {"operation": "Freeze and version approved copy", "output": "stable source manifest"},
        {"operation": "Assign project, chapter, batch, and segment IDs", "output": "resumable queue"},
        {"operation": "Persist every completed segment", "output": "narrow retry and restart recovery"},
        {"operation": "Normalize and assemble audio", "output": "chapter or full-volume audio"},
        {"operation": "Generate and validate per-chapter video", "output": "single long MP4 or episodic delivery"}
      ]
    },
    {
      "id": "qa-recovery",
      "name": {"zh-CN": "测试、验收与恢复", "en": "QA, acceptance, and recovery"},
      "checks": ["input validation", "per-engine smoke test", "sample rate and peak checks", "missing/duplicate segment audit", "caption boundary checks", "H.264/AAC ffprobe validation", "hardware fallback", "pause/cancel/restart recovery", "responsive UI review"]
    },
    {
      "id": "agent-ready-publishing",
      "name": {"zh-CN": "AI 检索与发布", "en": "Agent-ready publishing"},
      "outputs": ["semantic HTML", "literal technical headings", "Schema.org JSON-LD", "Chinese and English canonical routes", "hreflang", "robots.txt", "sitemap.xml", "llms.txt", "llms-full.txt", "site.json", "models.json", "development.json"]
    }
  ],
  "contact": "wangdexin2008@126.com"
}
