dsh-xiaomi-tts 2.2.1 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.en.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  <p><a href="README.md"><strong>中文说明 →</strong></a></p>
4
4
 
5
- Xiaomi MiMo text-to-speech controls for finalized assistant messages in DeepSeek Harness Web.
5
+ Add Xiaomi MiMo TTS read-aloud playback to assistant replies in DeepSeek Harness Web.
6
6
 
7
7
  > Powered by Xiaomi MiMo TTS models to turn assistant replies into smooth, clear natural speech. MiMo TTS is currently free for a limited time; refer to Xiaomi MiMo for the current policy.
8
8
 
@@ -16,72 +16,103 @@ Xiaomi MiMo text-to-speech controls for finalized assistant messages in DeepSeek
16
16
 
17
17
  ## Features
18
18
 
19
- - Adds an optional read-aloud button to the assistant message action strip; it is enabled by default.
20
- - Uses Xiaomi MiMo's currently free-for-a-limited-time TTS models: `mimo-v2.5-tts` produces smooth, clear audio; preset-voice autoplay uses streaming PCM16, while manual playback uses MP3 or WAV.
19
+ - Shows a read-aloud button below each completed assistant reply body when needed; enabled by default.
20
+ - Uses Xiaomi MiMo's currently limited-time-free TTS models: `mimo-v2.5-tts` outputs smooth, clear audio; preset-voice autoplay uses streaming PCM16, while manual playback uses MP3 or WAV.
21
21
  - Uses `mimo-v2.5-tts-voicedesign` Voice Design to create the voice you want from a text description.
22
- - Switches between preset voices and custom voice design, and configures the API key, autoplay, built-in voice, voice description, and MP3/WAV format under **Settings → Plugins → Plugin configuration**. The voice-design selector defaults to **Custom**; custom text can be edited and saved, then restored after switching to another template.
23
- - Keeps the API key on the DSH Host. The browser sends only the response text to a same-origin plugin route.
24
- - Supports pause, resume, regeneration, request errors, and browser autoplay rejection. Automatic playback only applies to the latest reply completed by the live run; opening messages from history does not play them.
25
- - Cleans speech text before sending it to TTS: URLs, file paths, code blocks, emoji, icons, and control characters are removed, and common Chinese punctuation is converted to ASCII punctuation.
22
+ - Lets you switch between the preset-voice model and the custom voice-design model under **Settings → Plugins → Plugin configuration**, and configure the API key, autoplay, voice, voice description, and format.
23
+ - Keeps the API key on the DSH Host. The browser sends only the reply body text to a same-origin Host route.
24
+ - Supports pause, resume, regeneration, and autoplay-blocked prompts. Automatic playback only triggers for the latest reply newly completed in the current run; opening messages from history does not play them.
25
+ - Aggressively cleans speech text before sending it to TTS: URLs, file paths, code blocks, emoji, icons, and control characters are removed, and common Chinese punctuation is converted to ASCII punctuation.
26
26
 
27
- Official Xiaomi MiMo TTS reference: <https://mimo.mi.com/static/docs/api/audio/tts.md>
27
+ ## Requirements
28
+
29
+ - `@deepseek-ai/dsh` `0.1.0-rc.7` or a compatible version
30
+ - Node.js 22+
31
+ - Xiaomi MiMo API Key
32
+
33
+ Official Xiaomi MiMo TTS API reference: <https://mimo.mi.com/static/docs/api/audio/tts.md>
28
34
 
29
35
  ## Install
30
36
 
37
+ Install from npm:
38
+
31
39
  ```bash
32
40
  dsh plugin --profile web add dsh-xiaomi-tts
33
41
  ```
34
42
 
35
- Restart `dsh web`, then open **Settings → Plugins → Plugin configuration** and save a Xiaomi MiMo API key.
43
+ Install from a local directory:
44
+
45
+ ```bash
46
+ dsh plugin --profile web add ./dsh-plugin-xiaomi-mimo-tts
47
+ ```
48
+
49
+ Install from GitHub:
50
+
51
+ ```bash
52
+ dsh plugin --profile web add github:ppy-web/dsh-plugin-xiaomi-mimo-tts
53
+ ```
54
+
55
+ After installation, restart `dsh web`, then open **Settings → Plugins → Plugin configuration → Xiaomi MiMo Read Aloud**, enter the API key, and save.
36
56
 
37
57
  When updating or switching from the local development link to the npm package, stop DSH Web before changing the profile dependencies. This prevents a running Node process from holding the Windows Junction that pnpm needs to replace:
38
58
 
39
59
  ```powershell
40
- .\start\dsh-plugin-reinstall.bat 2.2.1
60
+ .\start\dsh-plugin-reinstall.bat 2.3.0
41
61
  ```
42
62
 
43
- The script stops DSH Web, removes the plugin from the `web` profile, installs the requested npm version, and starts DSH Web again. If you run the steps manually, keep the same order:
63
+ The script stops DSH Web, removes the current plugin from the profile, installs the requested npm version, and starts DSH Web again. If you run the steps manually, keep the same order:
44
64
 
45
65
  ```powershell
46
66
  .\start\dsh-web-stop.bat
47
67
  dsh plugin --profile web remove dsh-xiaomi-tts
48
- dsh plugin --profile web add dsh-xiaomi-tts@2.2.1
68
+ dsh plugin --profile web add dsh-xiaomi-tts@2.3.0
49
69
  .\start\dsh-web-start.bat
50
70
  ```
51
71
 
52
- When `mimo-v2.5-tts-voicedesign` is selected, Voice Design creates the voice you want from a text description. The plugin omits `audio.voice`, sends only the custom voice description as the upstream `user` message, and sends the reply text as the `assistant` message. No preset-voice or general read-aloud style prompt is added. Describe the voice itself in one or two sentences, including age/gender, texture, pace, and emotional baseline; avoid scenes or actions.
72
+ ## Configuration
53
73
 
54
- The settings card also provides common voice-description templates from the reference page; every template remains editable after selection.
74
+ Available built-in voices for `mimo-v2.5-tts`:
55
75
 
56
- Preset voices also receive `presetStylePrompt` as a style instruction. It is sent only with `mimo-v2.5-tts` and does not affect Voice Design. The default favors clear, natural Mandarin, a subtle Hunan inflection, and a cool, restrained delivery.
76
+ - Chinese female: `冰糖`, `茉莉`
77
+ - Chinese male: `苏打`, `白桦`
78
+ - English female: `Mia`, `Chloe`
79
+ - English male: `Milo`, `Dean`
57
80
 
58
- The settings include the API key, read-aloud button, automatic read-aloud, model, voice, custom voice description, and audio format. Both switches are enabled by default; disabling the read-aloud button also disables automatic read-aloud, while enabling automatic read-aloud enables the button.
81
+ Custom voice design with `mimo-v2.5-tts-voicedesign`
59
82
 
60
- Browsers may block autoplay. If that happens, click the read-aloud button below a response.
83
+ The plugin provides common voice-description templates. The selector defaults to **Custom**, so users can edit and save the description directly. After switching to another template and back to **Custom**, the previously saved custom content is restored.
61
84
 
62
- ### Speech text preprocessing
85
+ ```text
86
+ Young adult woman, bright and approachable voice, clear articulation, moderate pace, gentle and restrained emotional tone.
87
+ ```
63
88
 
64
- Read-aloud uses cleaned text and does not modify the assistant reply shown in the chat. Markdown links keep their readable labels while their targets are removed; URLs, file paths, complete code blocks, emoji, icons, zero-width characters, and control characters are not sent to Xiaomi MiMo. Parentheses, brackets, book-title marks, quotation marks, and other non-boundary punctuation are removed; retained boundary punctuation is converted to ASCII. Streaming playback accumulates at least 20 spoken characters, then sends any remaining shorter text when the reply ends.
89
+ It is recommended to describe age and gender, vocal texture, speaking pace, and emotional baseline, while avoiding scenes or actions. Preset-voice mode still uses the built-in voice configuration.
65
90
 
66
- ## Development
91
+ Browsers may block autoplay. If that happens, click the read-aloud button first.
67
92
 
68
- ```bash
69
- pnpm install
70
- pnpm typecheck
71
- pnpm test
72
- pnpm pack:check
73
- ```
93
+ ### Speech text preprocessing
94
+
95
+ Read-aloud uses only the cleaned reply body and does not modify the assistant message shown in the chat. Markdown links keep their readable labels while their targets are removed; URLs, file paths, complete code blocks, emoji, icons, zero-width characters, and control characters are not sent to Xiaomi MiMo. Parentheses, brackets, book-title marks, quotation marks, and other non-boundary punctuation are removed; retained sentence-boundary punctuation is converted to ASCII. Streaming playback accumulates at least 20 speakable characters, then sends any remaining shorter text when the reply ends.
74
96
 
75
97
  ## Privacy
76
98
 
77
99
  - The API key stays on the DSH Host and is never sent to the browser.
78
- - Response text is sent to Xiaomi MiMo when speech is generated.
100
+ - Reply text is sent to Xiaomi MiMo when speech is generated.
79
101
  - Audio is played through a temporary Blob URL and is not persisted to disk.
80
102
 
81
103
  ## Feedback and support
82
104
 
83
105
  Please use [GitHub Issues](https://github.com/ppy-web/dsh-plugin-xiaomi-mimo-tts/issues) for bug reports, feature requests, or feedback.
84
106
 
107
+ ## Development
108
+
109
+ ```bash
110
+ pnpm install
111
+ pnpm typecheck
112
+ pnpm test
113
+ pnpm pack:check
114
+ ```
115
+
85
116
  ## License
86
117
 
87
118
  MIT
package/README.md CHANGED
@@ -57,7 +57,7 @@ dsh plugin --profile web add github:ppy-web/dsh-plugin-xiaomi-mimo-tts
57
57
  更新或从本地开发版切换到 npm 版时,必须先停止 DSH Web,避免 Windows Junction 被运行中的 Node 进程占用:
58
58
 
59
59
  ```powershell
60
- .\start\dsh-plugin-reinstall.bat 2.2.1
60
+ .\start\dsh-plugin-reinstall.bat 2.3.0
61
61
  ```
62
62
 
63
63
  这个脚本会按顺序停止 DSH Web、卸载当前 profile 中的插件、从 npm 安装指定版本并重新启动 DSH Web。若手动操作,请保持相同顺序:
@@ -65,7 +65,7 @@ dsh plugin --profile web add github:ppy-web/dsh-plugin-xiaomi-mimo-tts
65
65
  ```powershell
66
66
  .\start\dsh-web-stop.bat
67
67
  dsh plugin --profile web remove dsh-xiaomi-tts
68
- dsh plugin --profile web add dsh-xiaomi-tts@2.2.1
68
+ dsh plugin --profile web add dsh-xiaomi-tts@2.3.0
69
69
  .\start\dsh-web-start.bat
70
70
  ```
71
71
 
@@ -78,9 +78,9 @@ dsh plugin --profile web add dsh-xiaomi-tts@2.2.1
78
78
  - 英文女声:`Mia`、`Chloe`
79
79
  - 英文男声:`Milo`、`Dean`
80
80
 
81
- 切换到 `mimo-v2.5-tts-voicedesign` 后,可以通过 Voice Design 用文字创造你想要的声音。插件不会发送 `audio.voice`,而是只把“自定义音色描述”作为上游 `user` 消息,把回复正文作为 `assistant` 消息发送;不会追加预置音色或通用朗读风格提示。音色描述建议写成一到两句,只描述声音本身,例如:
81
+ 自定义音色(`mimo-v2.5-tts-voicedesign`)
82
82
 
83
- 设置卡提供参考页中的常用音色描述模板;下拉框默认选择“自定义”,用户可以直接修改并保存描述。切换到其他模板后再切回“自定义”时,会恢复之前保存的自定义内容。
83
+ 为你提供了常用音色描述模板;下拉框默认选择“自定义”,用户可以直接修改并保存描述。切换到其他模板后再切回“自定义”时,会恢复之前保存的自定义内容。
84
84
 
85
85
  ```text
86
86
  青年女性,声线清亮、亲切自然,吐字清楚,语速适中,情绪温柔克制。
@@ -88,11 +88,7 @@ dsh plugin --profile web add dsh-xiaomi-tts@2.2.1
88
88
 
89
89
  建议包含年龄段与性别、声音质感、语速节奏和情绪底色,不写场景或动作。预置音色模式仍使用原来的内置音色配置。
90
90
 
91
- 预置音色会额外使用 `presetStylePrompt` 作为朗读风格提示词;它仅在 `mimo-v2.5-tts` 下发送,不会影响 Voice Design。默认提示词强调清晰自然、轻微湖南语感和冷静克制的表达。
92
-
93
- 配置项包括 API Key、朗读按钮、自动播报、模型、内置音色、音色描述和音频格式。两个开关默认开启;关闭朗读按钮会同步关闭自动播报,开启自动播报会自动开启朗读按钮。
94
-
95
- 浏览器可能阻止自动播放;遇到这种情况,请点击回复下方的朗读按钮。
91
+ 浏览器可能阻止自动播放;遇到这种情况,请先尝试点击朗读按钮。
96
92
 
97
93
  ### 朗读文本处理
98
94
 
package/assets/preset.png CHANGED
Binary file
package/cordis.patch.yml CHANGED
@@ -11,9 +11,9 @@
11
11
  voice: '冰糖'
12
12
  voiceDesignPrompt: '青年女性,声线清亮、亲切自然,吐字清楚,语速适中,情绪温柔克制。'
13
13
  voiceDesignCustomPrompt: '青年女性,声线清亮、亲切自然,吐字清楚,语速适中,情绪温柔克制。'
14
- presetStylePrompt: '使用清晰自然的普通话朗读,可带轻微湖南语感,但不影响清晰度。整体声线清冷、克制,略带距离感;发声收敛,气息自然,语速中等偏快,句间停顿干脆。仅在情绪关键词处轻微延长尾音,避免夸张、戏剧化或过度气声。'
14
+ presetStylePrompt: '使用清晰、自然、准确的声音朗读,语速适中,停顿自然,语气平和克制,避免夸张表达。'
15
15
  format: 'mp3'
16
16
  autoPlay: true
17
- instruction: '请用自然、清晰、语速适中的语气朗读。'
17
+ instruction: '请忠实朗读原文,根据文本语气自然表达,不添加或改写内容。'
18
18
  maxTextLength: 12000
19
19
  requestTimeoutMs: 120000
@@ -22,12 +22,14 @@ declare const zh: {
22
22
  readonly 'settings.autoPlay': "开启自动播报";
23
23
  readonly 'settings.autoPlayHint': "开启时会同步显示朗读按钮;浏览器也可能拒绝自动播放。";
24
24
  readonly 'settings.model': "TTS 模型";
25
- readonly 'settings.presetModel': "预置音色模型";
26
- readonly 'settings.voiceDesignModel': "自定义音色模型";
25
+ readonly 'settings.presetModel': "预置音色模型 (mimo-v2.5-tts)";
26
+ readonly 'settings.voiceDesignModel': "自定义音色模型 (mimo-v2.5-tts-voicedesign)";
27
27
  readonly 'settings.modelAutoPlayHintPreset': "预置音色模型支持实时流式播放。";
28
28
  readonly 'settings.modelAutoPlayHintVoiceDesign': "自定义音色仅支持在回复完成后自动播放。";
29
29
  readonly 'settings.voice': "内置音色";
30
30
  readonly 'settings.voiceDesignPrompt': "自定义音色描述";
31
+ readonly 'settings.customVoiceOption': "自定义";
32
+ readonly 'settings.customVoiceSummary': "手动编写音色描述";
31
33
  readonly 'settings.voiceDesignPromptHint': "按“年龄段 + 性别、声音质感、语速节奏、情绪底色”描述声音本身;不写场景或动作。";
32
34
  readonly 'settings.format': "音频格式";
33
35
  readonly 'settings.save': "保存";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,aAAa,EAAuC,MAAM,wCAAwC,CAAA;AAqBhH,+CAA+C;AAC/C,eAAO,MAAM,MAAM,UAMlB,CAAA;AAgBD,QAAA,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyCE,CAAA;AA6CV,KAAK,SAAS,GAAG,MAAM,OAAO,EAAE,CAAA;AAIhC,OAAO,QAAQ,kCAAkC,CAAC;IAChD,UAAU,kBAAkB;QAC1B,iBAAiB,EAAE,SAAS,CAAA;KAC7B;CACF;AAm+BD,+EAA+E;AAC/E,wBAAgB,KAAK,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CA8D9C"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,aAAa,EAAuC,MAAM,wCAAwC,CAAA;AAuBhH,+CAA+C;AAC/C,eAAO,MAAM,MAAM,UAMlB,CAAA;AAiBD,QAAA,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2CE,CAAA;AA+CV,KAAK,SAAS,GAAG,MAAM,OAAO,EAAE,CAAA;AAIhC,OAAO,QAAQ,kCAAkC,CAAC;IAChD,UAAU,kBAAkB;QAC1B,iBAAiB,EAAE,SAAS,CAAA;KAC7B;CACF;AAotCD,+EAA+E;AAC/E,wBAAgB,KAAK,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAwD9C"}