{
  "name": "tts-polyphone-demo",
  "baseLanguage": "zh-CN",
  "target": {
    "url": "http://127.0.0.1:8799/",
    "viewport": {
      "width": 1280,
      "height": 720
    },
    "browser": "chromium",
    "locale": "zh-CN",
    "headless": true
  },
  "setup": {
    "cleanup": "default",
    "launch": [
      {
        "name": "demo-page",
        "type": "command",
        "command": "python3",
        "args": [
          "-m",
          "http.server",
          "8799",
          "--directory",
          "${projectDir}/assets"
        ],
        "ready": {
          "url": "http://127.0.0.1:8799/",
          "status": 200
        }
      }
    ],
    "verify": [
      {
        "name": "page",
        "url": "http://127.0.0.1:8799/",
        "asserts": [
          {
            "kind": "text",
            "selector": "h1",
            "value": "tts-polyphone"
          }
        ]
      }
    ]
  },
  "tts": {
    "engine": "edge",
    "voice": "zh-CN-XiaoxiaoNeural"
  },
  "subtitle": {
    "style": "bottom-bar",
    "lang": "zh-CN",
    "fontName": "Noto Sans CJK SC",
    "fontSize": 22
  },
  "pronounce": {
    "useDefaults": true
  },
  "output": {
    "format": "mp4",
    "chapters": true
  },
  "steps": [
    {
      "action": "goto",
      "url": "http://127.0.0.1:8799/",
      "narration": "这是一个中文多音字朗读纠正库。语音合成念「一行代码」，很容易把行字念错。",
      "pronounce": {
        "rules": [
          {
            "from": "把行字念错",
            "to": "把航字念错",
            "note": "narration references the character itself; keep háng throughout this line"
          }
        ]
      }
    },
    {
      "action": "evaluate",
      "narration": "屏幕上显示的一直是原文，改写的只有发给语音合成的文本。",
      "fn": "document.getElementById('problem').scrollIntoView({block:'start'}); true"
    },
    {
      "action": "evaluate",
      "narration": "做法是同音同调替身字：合成器收到的是「一航代码」，发音完全一致，用户看到的文字不变。",
      "fn": "document.getElementById('how').scrollIntoView({block:'start'}); true"
    },
    {
      "action": "evaluate",
      "narration": "内置默认表覆盖了常见易错词：一行人、中标、湖泊、刹车、曝光、抗住，都来自社区纠错词表并经人工审核。",
      "fn": "document.getElementById('examples').scrollIntoView({block:'start'}); true"
    },
    {
      "action": "evaluate",
      "narration": "行数统计也处理了。第3行、第一百行、三千行、一百二十三行，还有 3行4列，全部正确。",
      "fn": "document.getElementById('digits').scrollIntoView({block:'start'}); true"
    },
    {
      "action": "evaluate",
      "narration": "同一份规则表，驱动三种接入：JavaScript 命令行、Java、还有 Rust。视频工作室和跟读模式已经接入。",
      "fn": "document.getElementById('ports').scrollIntoView({block:'start'}); true"
    },
    {
      "action": "evaluate",
      "narration": "默认表来自两个社区纠错词表，经人工审核。规则变了，只有受影响的句子会重新合成。",
      "fn": "document.getElementById('source').scrollIntoView({block:'start'}); true"
    },
    {
      "action": "evaluate",
      "narration": "命令行即可接入：一行输入，一行口播输出。包名与文档见屏幕。",
      "fn": "document.getElementById('cli').scrollIntoView({block:'start'}); true"
    }
  ]
}