dsh-xiaomi-tts 3.0.3 → 3.0.4-alpha
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 +109 -84
- package/README.md +103 -75
- package/assets/audio/auto-off03.mp3 +0 -0
- package/assets/setting.png +0 -0
- package/assets/ui/sound-effects-whale.webp +0 -0
- package/cordis.patch.yml +4 -1
- package/lib/client/conversation/read-aloud.d.ts.map +1 -1
- package/lib/client/index.d.ts.map +1 -1
- package/lib/client/localization.d.ts +37 -28
- package/lib/client/localization.d.ts.map +1 -1
- package/lib/client/playback/preview-player.d.ts +12 -3
- package/lib/client/playback/preview-player.d.ts.map +1 -1
- package/lib/client/settings/api-key-module.d.ts +4 -3
- package/lib/client/settings/api-key-module.d.ts.map +1 -1
- package/lib/client/settings/api-key-state.d.ts +5 -0
- package/lib/client/settings/api-key-state.d.ts.map +1 -0
- package/lib/client/settings/card.d.ts +2 -5
- package/lib/client/settings/card.d.ts.map +1 -1
- package/lib/client/settings/collapsible-module.d.ts.map +1 -1
- package/lib/client/settings/controls/built-in-voice-picker.d.ts.map +1 -1
- package/lib/client/settings/controls/local-voice-picker.d.ts +2 -1
- package/lib/client/settings/controls/local-voice-picker.d.ts.map +1 -1
- package/lib/client/settings/controls/voice-design-picker.d.ts.map +1 -1
- package/lib/client/settings/details-module.d.ts +2 -11
- package/lib/client/settings/details-module.d.ts.map +1 -1
- package/lib/client/settings/field-heading.d.ts +2 -2
- package/lib/client/settings/field-heading.d.ts.map +1 -1
- package/lib/client/settings/module-shell.d.ts +17 -0
- package/lib/client/settings/module-shell.d.ts.map +1 -0
- package/lib/client/settings/preview-module.d.ts +4 -2
- package/lib/client/settings/preview-module.d.ts.map +1 -1
- package/lib/client/settings/sound-effects-module.d.ts +2 -2
- package/lib/client/settings/sound-effects-module.d.ts.map +1 -1
- package/lib/client/settings/types.d.ts +0 -1
- package/lib/client/settings/types.d.ts.map +1 -1
- package/lib/client/sound-effects/task-watcher.d.ts.map +1 -1
- package/lib/client.js +433 -422
- package/lib/client.js.map +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -349
- package/lib/pcm-stream.js +1 -1
- package/lib/{shared-DJtQ85KH.js → shared-BJGcWLzB.js} +51 -12
- package/lib/shared.d.ts +17 -13
- package/lib/shared.d.ts.map +1 -1
- package/lib/shared.js +2 -2
- package/package.json +30 -44
package/README.en.md
CHANGED
|
@@ -1,132 +1,151 @@
|
|
|
1
|
-

|
|
2
2
|
|
|
3
3
|
# dsh-xiaomi-tts
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/dsh-xiaomi-tts)
|
|
6
6
|
[](https://github.com/ppy-web/dsh-plugin-xiaomi-mimo-tts)
|
|
7
|
+
[](https://www.npmjs.com/package/dsh-xiaomi-tts)
|
|
8
|
+
[](https://github.com/deepseek-ai)
|
|
9
|
+

|
|
7
10
|
|
|
8
|
-
Add Xiaomi MiMo TTS read-aloud
|
|
11
|
+
Add Xiaomi MiMo TTS read-aloud, browser-local fallback speech, and optional UI sounds to DSH Web.
|
|
9
12
|
|
|
10
|
-
>
|
|
13
|
+
> MiMo TTS availability and pricing may change. Check the official Xiaomi MiMo platform for the current policy.
|
|
11
14
|
|
|
12
15
|
<p><a href="README.md"><strong>中文说明 →</strong></a></p>
|
|
13
16
|
|
|
14
17
|
## 🎨 Preview
|
|
15
18
|
|
|
16
|
-
|
|
19
|
+
- [Open the interactive Preview Pages](https://ppy-web.github.io/dsh-plugin-xiaomi-mimo-tts)
|
|
20
|
+
|
|
21
|
+
| Settings | Message action |
|
|
17
22
|
|:---:|:---:|
|
|
18
|
-
|  |  |
|
|
23
|
+
|  |  |
|
|
21
24
|
|
|
22
25
|
## ✨ Features
|
|
23
26
|
|
|
24
|
-
- One-click read-aloud
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
27
|
+
- One-click read-aloud action on assistant messages.
|
|
28
|
+
- Low-latency PCM streaming for `mimo-v2.5-tts`, with complete-audio or browser-speech fallback when appropriate.
|
|
29
|
+
- Official built-in voices and text-described custom voices through `mimo-v2.5-tts-voicedesign`.
|
|
30
|
+
- MiMo-first, local-first, or MiMo-only speech strategies.
|
|
31
|
+
- Smart, full, and first-segment read-aloud ranges.
|
|
32
|
+
- 0.5×–2.0× playback speed, voice volume, pause, resume, and stop controls.
|
|
33
|
+
- Text preparation that removes URLs, paths, code blocks, emoji, and control characters before synthesis.
|
|
34
|
+
- Broadcast Studio previews that identify MiMo versus browser-local playback and explain common failures.
|
|
35
|
+
- Optional task and semantic click sounds, disabled by default.
|
|
36
|
+
- An optional PCM playback service for other DSH Web plugins.
|
|
31
37
|
|
|
32
38
|
## 📋 Requirements
|
|
33
39
|
|
|
34
|
-
- `@deepseek-ai/dsh` `0.1.
|
|
40
|
+
- `@deepseek-ai/dsh` `0.1.6-alpha.2` (the current compatibility target)
|
|
35
41
|
- Node.js 22+
|
|
36
|
-
- Xiaomi MiMo API
|
|
42
|
+
- A Xiaomi MiMo API key for MiMo speech
|
|
37
43
|
- [Official TTS API documentation](https://mimo.mi.com/models/zh-CN/mimo-v2.5-tts)
|
|
38
44
|
|
|
39
|
-
## 🚀
|
|
45
|
+
## 🚀 Installation
|
|
40
46
|
|
|
41
|
-
|
|
47
|
+
### Install from npm (recommended)
|
|
42
48
|
|
|
43
49
|
```bash
|
|
44
|
-
dsh plugin --profile web add dsh-xiaomi-tts
|
|
50
|
+
dsh plugin --profile web add dsh-xiaomi-tts@latest
|
|
45
51
|
```
|
|
46
52
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
Open **Settings → Plugin marketplace**, search for `xiaomi-mimo-tts`, and click **Install**.
|
|
53
|
+
### Install from the plugin marketplace
|
|
50
54
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
```text
|
|
54
|
-
Install the dsh-xiaomi-tts plugin on this computer's DSH.
|
|
55
|
-
1. Prefer: dsh plugin --profile web add dsh-xiaomi-tts@latest
|
|
56
|
-
2. If that fails, try the source repository: https://github.com/ppy-web/dsh-plugin-xiaomi-mimo-tts
|
|
57
|
-
```
|
|
55
|
+
If the plugin is available in the current DSH marketplace catalog, search for `xiaomi-mimo-tts` under **Settings → Plugin marketplace**.
|
|
58
56
|
|
|
59
|
-
|
|
57
|
+
### Install from GitHub
|
|
60
58
|
|
|
61
59
|
```bash
|
|
62
60
|
dsh plugin --profile web add github:ppy-web/dsh-plugin-xiaomi-mimo-tts
|
|
63
61
|
```
|
|
64
62
|
|
|
65
|
-
|
|
63
|
+
You can also download a `.tgz` from GitHub Releases:
|
|
66
64
|
|
|
67
65
|
```powershell
|
|
68
|
-
dsh plugin --profile web add "<download-path
|
|
66
|
+
dsh plugin --profile web add "<download-path>\dsh-xiaomi-tts-<version>.tgz"
|
|
69
67
|
```
|
|
70
68
|
|
|
71
|
-
Release tarballs
|
|
69
|
+
Release tarballs include the build output and do not require `pnpm approve-builds`.
|
|
72
70
|
|
|
73
|
-
After installation, restart
|
|
71
|
+
After installation, restart the running DSH Web `web` profile, then open:
|
|
74
72
|
|
|
75
|
-
|
|
73
|
+
**Sidebar → Plugins → dsh-xiaomi-tts → Text To Speech (Xiaomi MiMo)**
|
|
76
74
|
|
|
77
|
-
|
|
75
|
+
## 🐋 First use
|
|
78
76
|
|
|
79
|
-
|
|
77
|
+
New installations start with:
|
|
80
78
|
|
|
81
|
-
|
|
79
|
+
- the manual Read aloud action available;
|
|
80
|
+
- **automatic playback disabled**;
|
|
81
|
+
- **UI sound effects disabled**;
|
|
82
|
+
- browser-local fallback available under the default MiMo-first strategy, even before a MiMo key is saved.
|
|
82
83
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
Recommended setup order:
|
|
85
|
+
|
|
86
|
+
1. [Create a Xiaomi MiMo API key](https://platform.xiaomimimo.com/console/api-keys).
|
|
87
|
+
2. Enter it in the plugin settings and click **Save**.
|
|
88
|
+
3. Open Mixing Console and choose a model and voice.
|
|
89
|
+
4. Test it in Broadcast Studio; the status bubble identifies MiMo or browser-local speech.
|
|
90
|
+
5. Enable automatic playback and UI sounds only if wanted, then save again.
|
|
91
|
+
|
|
92
|
+
> A newly entered API key is used by MiMo only after it is saved to the DSH Host. Recognizing an `sk-` or `tp-` prefix is a format check, not server-side validation.
|
|
93
|
+
|
|
94
|
+
### Replace or clear an API key
|
|
95
|
+
|
|
96
|
+
- Entering and saving a new key replaces the key in the personal settings layer.
|
|
97
|
+
- **Clear** removes that personal override after Save.
|
|
98
|
+
- If a DSH base configuration still provides a key, clearing the personal override restores the inherited key. It does not revoke a key on Xiaomi's platform.
|
|
99
|
+
- Revoke the key in the Xiaomi MiMo console when it must be made unusable everywhere.
|
|
86
100
|
|
|
87
101
|
## ⚙️ Configuration
|
|
88
102
|
|
|
89
|
-
|
|
103
|
+
### Official built-in voices
|
|
104
|
+
|
|
105
|
+
`mimo-v2.5-tts` currently provides:
|
|
90
106
|
|
|
91
107
|
- Chinese female: `冰糖`, `茉莉`
|
|
92
108
|
- Chinese male: `苏打`, `白桦`
|
|
93
109
|
- English female: `Mia`, `Chloe`
|
|
94
110
|
- English male: `Milo`, `Dean`
|
|
95
111
|
|
|
96
|
-
|
|
112
|
+
### Custom voices
|
|
97
113
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
Common voice-description templates are provided, and you can edit and save the description directly:
|
|
114
|
+
`mimo-v2.5-tts-voicedesign` generates a voice from a description. The settings panel includes presets and an editable custom description:
|
|
102
115
|
|
|
103
116
|
```text
|
|
104
|
-
Young adult woman
|
|
117
|
+
Young adult woman with a bright, approachable voice, clear articulation, moderate pace, and a gentle, restrained emotional tone.
|
|
105
118
|
```
|
|
106
119
|
|
|
107
|
-
|
|
120
|
+
Voice descriptions support preset templates and direct manual editing; save the settings after changing one.
|
|
121
|
+
|
|
122
|
+
### Browser-local speech
|
|
123
|
+
|
|
124
|
+
- **MiMo first**: tries browser speech if MiMo fails before audio starts.
|
|
125
|
+
- **Local first**: uses browser speech first, then tries MiMo if local speech fails.
|
|
126
|
+
- **Disable local speech**: uses MiMo only.
|
|
108
127
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
- **Smart
|
|
114
|
-
- **Full mode**:
|
|
115
|
-
- **First-segment mode**:
|
|
116
|
-
|
|
117
|
-
|
|
128
|
+
Browser voices come from the Web Speech API. Offline availability, language coverage, and actual voice output depend on the browser, operating system, and their speech services.
|
|
129
|
+
|
|
130
|
+
### Read-aloud range
|
|
131
|
+
|
|
132
|
+
- **Smart mode**: automatic playback prefers the opening semantic segment and may add a short closing cue when substantial text remains. Manual playback reads the full reply.
|
|
133
|
+
- **Full mode**: automatic and manual playback both read the full reply.
|
|
134
|
+
- **First-segment mode**: automatic and manual playback both read only the opening segment.
|
|
135
|
+
|
|
136
|
+
The settings panel supports keyboard navigation: use `Tab` to move focus, arrow keys to adjust sliders and options, and `Space` to activate buttons and switches.
|
|
118
137
|
|
|
119
138
|
## 🔌 Third-party plugin integration
|
|
120
139
|
|
|
121
|
-
|
|
140
|
+
The plugin exposes an optional PCM streaming service to Web plugins:
|
|
122
141
|
|
|
123
142
|
```ts
|
|
124
143
|
ctx.get('xiaomiMimoTts')?.play('Welcome back')
|
|
125
144
|
```
|
|
126
145
|
|
|
127
|
-
Use `ctx.get()` dynamically
|
|
146
|
+
Use `ctx.get()` dynamically instead of declaring a required injection. The call safely does nothing when the plugin is missing, unavailable, or disabled. New playback interrupts the current read-aloud session, and `stop()` stops it explicitly.
|
|
128
147
|
|
|
129
|
-
For TypeScript
|
|
148
|
+
For TypeScript types:
|
|
130
149
|
|
|
131
150
|
```ts
|
|
132
151
|
import type { XiaomiMimoTtsService } from 'dsh-xiaomi-tts/client-api'
|
|
@@ -135,18 +154,20 @@ const tts = ctx.get('xiaomiMimoTts') as XiaomiMimoTtsService | undefined
|
|
|
135
154
|
tts?.play('Welcome back')
|
|
136
155
|
```
|
|
137
156
|
|
|
138
|
-
## 🔒 Privacy
|
|
157
|
+
## 🔒 Privacy and network access
|
|
139
158
|
|
|
140
|
-
- The API
|
|
141
|
-
-
|
|
142
|
-
-
|
|
159
|
+
- The DSH Host stores the API key. The browser reads only whether a key is configured and whether its prefix is recognized, not the secret itself.
|
|
160
|
+
- MiMo synthesis sends the spoken text and relevant voice instructions to Xiaomi MiMo.
|
|
161
|
+
- Browser-local speech uses the Web Speech API. Voices marked online may send text to browser, operating-system, or network speech services.
|
|
162
|
+
- Opening the settings card makes the DSH Host query the npm Registry for a newer plugin version.
|
|
163
|
+
- Audio plays from browser memory through Web Audio or temporary Blob URLs; the plugin does not intentionally persist generated audio.
|
|
143
164
|
- The sound core is migrated from [uisfx 0.4.0](https://github.com/romainsimon/uisfx) under the MIT License; see `NOTICE`.
|
|
144
165
|
|
|
145
166
|
## 🏗️ Architecture
|
|
146
167
|
|
|
147
|
-
- **Shared layer**:
|
|
148
|
-
- **Host plugin**:
|
|
149
|
-
- **Web Client**:
|
|
168
|
+
- **Shared layer**: defaults, text processing, segmentation, SSE, and playback contracts.
|
|
169
|
+
- **Host plugin**: settings and static assets, plus complete-audio and PCM streaming proxies for MiMo.
|
|
170
|
+
- **Web Client**: settings, message actions, browser-speech fallback, previews, and the optional third-party playback service.
|
|
150
171
|
|
|
151
172
|
```mermaid
|
|
152
173
|
flowchart LR
|
|
@@ -154,40 +175,44 @@ flowchart LR
|
|
|
154
175
|
THIRD["Third-party Web plugin"] -. "ctx.get('xiaomiMimoTts')" .-> CLIENT
|
|
155
176
|
CLIENT -->|"Complete audio / PCM stream"| HOST["Host plugin<br/>Settings and API proxy"]
|
|
156
177
|
HOST --> MIMO["Xiaomi MiMo API"]
|
|
157
|
-
CLIENT -->|"
|
|
158
|
-
SHARED["Shared layer<br/>Configuration, text
|
|
178
|
+
CLIENT -->|"Web Speech API"| SPEECH["Browser / system speech service"]
|
|
179
|
+
SHARED["Shared layer<br/>Configuration, text, SSE"] -.-> CLIENT
|
|
159
180
|
SHARED -.-> HOST
|
|
160
181
|
```
|
|
161
182
|
|
|
162
183
|
## 🛠️ Development
|
|
163
184
|
|
|
164
|
-
When editing the settings panel, run:
|
|
165
|
-
|
|
166
185
|
```bash
|
|
186
|
+
pnpm install
|
|
167
187
|
pnpm dev
|
|
168
188
|
```
|
|
169
189
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
Run the settings UI lab while editing the panel:
|
|
173
|
-
|
|
174
|
-
```bash
|
|
175
|
-
pnpm dev
|
|
176
|
-
```
|
|
190
|
+
`pnpm dev` starts the local UI Lab and renders `src/client/settings/card.tsx` directly. Saving, remote speech, and update checks are mocked locally; the preview does not call the real MiMo service.
|
|
177
191
|
|
|
178
|
-
|
|
192
|
+
Common checks:
|
|
179
193
|
|
|
180
194
|
```bash
|
|
181
|
-
pnpm install
|
|
182
195
|
pnpm typecheck
|
|
183
196
|
pnpm test
|
|
197
|
+
pnpm dev:build
|
|
184
198
|
pnpm pack:check
|
|
185
199
|
```
|
|
186
200
|
|
|
187
|
-
|
|
201
|
+
- `pnpm build`: normal build.
|
|
202
|
+
- `pnpm build:debug`: build with PCM-path debug logging enabled.
|
|
203
|
+
- `pnpm profile:check`: verify the installation in the local DSH Web profile.
|
|
204
|
+
|
|
205
|
+
On Windows, stop DSH Web before replacing a local development link with the npm package so the running Node process does not hold the Junction:
|
|
206
|
+
|
|
207
|
+
```powershell
|
|
208
|
+
.\start\dsh-plugin-reinstall.bat 3.0.4-alpha
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
## 🤝 Recommended plugins
|
|
188
212
|
|
|
189
|
-
|
|
213
|
+

|
|
190
214
|
|
|
191
|
-
- [dsh-whale
|
|
215
|
+
- [dsh-deep-whale](https://github.com/Small-tailqwq/dsh-deep-whale#readme): Whale Maid theme and skin series.
|
|
216
|
+
- [dsh-whale-musume](https://github.com/Sutera-Diffusus/dsh-whale-musume#readme): energetic Whale Maid desktop companion.
|
|
192
217
|
- [dsh-plugin-uisfx](https://github.com/XanthanL/dsh-plugin-uisfx#readme): semantic UI sound effects.
|
|
193
218
|
- [dsh-dream-skin](https://github.com/RevolutionLA/dsh-dream-skin#readme): native skins, wallpapers, accent colors, and theme packs.
|
package/README.md
CHANGED
|
@@ -6,124 +6,146 @@
|
|
|
6
6
|
[](https://github.com/ppy-web/dsh-plugin-xiaomi-mimo-tts)
|
|
7
7
|
[](https://www.npmjs.com/package/dsh-xiaomi-tts)
|
|
8
8
|
[](https://github.com/deepseek-ai)
|
|
9
|
-

|
|
10
10
|
|
|
11
|
-
为 DSH Web 添加 Xiaomi MiMo TTS
|
|
11
|
+
为 DSH Web 添加 Xiaomi MiMo TTS 语音朗读、浏览器本地语音兜底和可选 UI 音效。
|
|
12
12
|
|
|
13
|
-
>
|
|
13
|
+
> MiMo TTS 当前可能处于限时免费或调整计费阶段,请以 Xiaomi MiMo 官方平台的最新政策为准。
|
|
14
14
|
|
|
15
15
|
<p><a href="README.en.md"><strong>English README →</strong></a></p>
|
|
16
16
|
|
|
17
17
|
## 🎨 预览
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
- [在线打开 Preview Pages](https://ppy-web.github.io/dsh-plugin-xiaomi-mimo-tts)
|
|
20
20
|
|
|
21
|
-
| 设置界面 |
|
|
21
|
+
| 设置界面 | 对话朗读入口 |
|
|
22
22
|
|:---:|:---:|
|
|
23
|
-
|  |  |
|
|
24
24
|
|
|
25
25
|
## ✨ 功能
|
|
26
26
|
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
33
|
-
-
|
|
27
|
+
- 一键朗读:在助手消息操作栏中提供“朗读”按钮。
|
|
28
|
+
- 低延迟播放:`mimo-v2.5-tts` 支持 PCM 流式播放,并在必要时回退到完整音频或浏览器语音。
|
|
29
|
+
- 内置与自定义音色:支持官方内置音色,以及 `mimo-v2.5-tts-voicedesign` 音色描述。
|
|
30
|
+
- 浏览器本地语音:可选择 MiMo 优先、本地优先或仅使用 MiMo。
|
|
31
|
+
- 朗读范围:支持智能、全文和首段模式。
|
|
32
|
+
- 播放控制:支持 0.5×–2.0× 语速、语音音量、暂停、继续和停止。
|
|
33
|
+
- 文本清洗:朗读前移除网址、路径、代码块、表情符号和控制字符等不适合播报的内容。
|
|
34
|
+
- 演播厅:试听时明确显示正在使用 MiMo 还是浏览器本地语音,并区分常见失败原因。
|
|
35
|
+
- 可选音效:提供任务状态和语义化点击音效,默认关闭。
|
|
36
|
+
- 插件联动:向其他 DSH Web 插件暴露可选的 PCM 播放服务。
|
|
34
37
|
|
|
35
38
|
## 📋 环境要求
|
|
36
39
|
|
|
37
|
-
- `@deepseek-ai/dsh` `0.1.
|
|
40
|
+
- `@deepseek-ai/dsh` `0.1.6-alpha.2`(当前兼容目标版本)
|
|
38
41
|
- Node.js 22+
|
|
39
|
-
- Xiaomi MiMo API Key
|
|
42
|
+
- 使用 MiMo 语音时需要 Xiaomi MiMo API Key
|
|
40
43
|
- [官方 TTS API 文档](https://mimo.mi.com/models/zh-CN/mimo-v2.5-tts)
|
|
41
44
|
|
|
42
|
-
## 🚀
|
|
45
|
+
## 🚀 安装
|
|
43
46
|
|
|
44
|
-
|
|
47
|
+
### 从 npm 安装(推荐)
|
|
45
48
|
|
|
46
49
|
```bash
|
|
47
|
-
dsh plugin --profile web add dsh-xiaomi-tts
|
|
50
|
+
dsh plugin --profile web add dsh-xiaomi-tts@latest
|
|
48
51
|
```
|
|
49
52
|
|
|
50
|
-
|
|
53
|
+
### 从插件市场安装
|
|
51
54
|
|
|
52
|
-
|
|
55
|
+
当前 DSH 插件市场已收录本插件,可在 **设置 → 插件市场** 中搜索 `xiaomi-mimo-tts`。
|
|
53
56
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
```text
|
|
57
|
-
帮我给此电脑上的dsh安装 dsh-xiaomi-tts 插件。
|
|
58
|
-
1. 优先通过命令安装 dsh plugin --profile web add dsh-xiaomi-tts@latest
|
|
59
|
-
2. 如果失败,请尝试源码 https://github.com/ppy-web/dsh-plugin-xiaomi-mimo-tts
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
- 从 GitHub 安装:
|
|
57
|
+
### 从 GitHub 安装
|
|
63
58
|
|
|
64
59
|
```bash
|
|
65
60
|
dsh plugin --profile web add github:ppy-web/dsh-plugin-xiaomi-mimo-tts
|
|
66
61
|
```
|
|
67
62
|
|
|
68
|
-
|
|
63
|
+
也可以下载 GitHub Release 中的 `.tgz`:
|
|
69
64
|
|
|
70
65
|
```powershell
|
|
71
66
|
dsh plugin --profile web add "<下载路径>\dsh-xiaomi-tts-<版本>.tgz"
|
|
72
67
|
```
|
|
73
68
|
|
|
74
|
-
Release
|
|
69
|
+
Release 压缩包已包含构建产物,无需执行 `pnpm approve-builds`。
|
|
70
|
+
|
|
71
|
+
安装完成后,重启正在运行的 DSH Web `web` profile,然后打开:
|
|
72
|
+
|
|
73
|
+
**侧边栏 → 插件 → dsh-xiaomi-tts → 语音朗读 (Xiaomi MiMo)**
|
|
75
74
|
|
|
76
|
-
|
|
77
|
-
[获取并填写 API Key](https://platform.xiaomimimo.com/console/api-keys) 。支持标准API Key / Token Plan 专属 API key
|
|
75
|
+
## 🐋 首次使用
|
|
78
76
|
|
|
79
|
-
|
|
77
|
+
新安装的默认行为:
|
|
80
78
|
|
|
81
|
-
|
|
79
|
+
- 朗读按钮可用;
|
|
80
|
+
- **自动播报默认关闭**;
|
|
81
|
+
- **UI 音效默认关闭**;
|
|
82
|
+
- 未保存 API Key 时,“MiMo 优先”策略可能回退到浏览器本地语音。
|
|
82
83
|
|
|
83
|
-
|
|
84
|
+
推荐配置顺序:
|
|
84
85
|
|
|
85
|
-
|
|
86
|
+
1. [获取 Xiaomi MiMo API Key](https://platform.xiaomimimo.com/console/api-keys)。
|
|
87
|
+
2. 在插件设置中输入 Key,并点击底部 **保存**。
|
|
88
|
+
3. 打开“调音台”,选择模型和音色。
|
|
89
|
+
4. 在“演播厅”试听;状态气泡会显示实际使用的是 MiMo 还是浏览器本地语音。
|
|
90
|
+
5. 按需开启自动播报和 UI 音效,再次保存。
|
|
86
91
|
|
|
87
|
-
|
|
92
|
+
> 新输入的 API Key 只有保存到 DSH Host 后才会用于 MiMo 试听。界面中的 `sk-` / `tp-` 检查只是格式识别,不代表服务端已经验证密钥有效。
|
|
93
|
+
|
|
94
|
+
### 更换或清除 API Key
|
|
95
|
+
|
|
96
|
+
- 输入新 Key 并保存,会替换当前个人设置层的密钥。
|
|
97
|
+
- 点击 **清除** 并保存,会移除当前用户层覆盖。
|
|
98
|
+
- 如果 DSH 基础配置仍提供密钥,清除个人覆盖后会恢复继承该密钥;因此该操作不等同于撤销 Xiaomi 平台上的密钥。
|
|
99
|
+
- 如需彻底失效,请同时前往 Xiaomi MiMo 控制台撤销对应 Key。
|
|
100
|
+
|
|
101
|
+
## ⚙️ 配置说明
|
|
102
|
+
|
|
103
|
+
### 官方内置音色
|
|
104
|
+
|
|
105
|
+
`mimo-v2.5-tts` 当前提供:
|
|
88
106
|
|
|
89
107
|
- 中文女声:`冰糖`、`茉莉`
|
|
90
108
|
- 中文男声:`苏打`、`白桦`
|
|
91
109
|
- 英文女声:`Mia`、`Chloe`
|
|
92
110
|
- 英文男声:`Milo`、`Dean`
|
|
93
111
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
112
|
+
### 自定义音色
|
|
113
|
+
|
|
114
|
+
`mimo-v2.5-tts-voicedesign` 支持从音色描述生成声音。设置面板包含预设模板,也可以手动编辑:
|
|
115
|
+
|
|
97
116
|
```text
|
|
98
117
|
青年女性,声线清亮、亲切自然,吐字清楚,语速适中,情绪温柔克制。
|
|
99
118
|
```
|
|
100
119
|
|
|
101
|
-
|
|
120
|
+
音色描述支持预设模板,也可以直接手动编辑;修改后需要保存设置。
|
|
121
|
+
|
|
122
|
+
### 浏览器本地语音
|
|
123
|
+
|
|
124
|
+
- **MiMo 优先**:MiMo 在首段音频开始前失败时,尝试浏览器语音。
|
|
125
|
+
- **本地优先**:先使用浏览器语音,失败后尝试 MiMo。
|
|
126
|
+
- **关闭本地语音**:只使用 MiMo,不进行本地兜底。
|
|
127
|
+
|
|
128
|
+
浏览器音色来自 Web Speech API。是否离线、可用语言和实际声音取决于浏览器、操作系统及其语音服务。
|
|
129
|
+
|
|
130
|
+
### 朗读范围
|
|
131
|
+
|
|
132
|
+
- **智能模式**:自动播报优先朗读首个语义段;未读内容较多时可能补一句收尾提示。手动朗读播放全文。
|
|
133
|
+
- **全文模式**:自动播报和手动朗读都播放全文。
|
|
134
|
+
- **首段模式**:自动播报和手动朗读都只播放首个语义段。
|
|
102
135
|
|
|
103
|
-
|
|
104
|
-
可选音色来自浏览器 Web Speech API,是否离线及实际可用范围取决于浏览器、操作系统和网络服务。
|
|
105
|
-
|
|
106
|
-
**朗读范围**
|
|
107
|
-
|
|
108
|
-
- **智能选择**:自动播报优先朗读回复的首个语义段;手动点击“朗读”时播放全文。短回复没有可拆分的段落时会完整播放。
|
|
109
|
-
- **全文模式**:自动播报和手动朗读都播放全文。
|
|
110
|
-
- **首段模式**:自动播报和手动朗读都只播放首个语义段。
|
|
111
|
-
|
|
112
|
-
设置面板支持键盘操作:按 `Tab` 在控件间移动,使用方向键调整滑块或切换选项,按空格确认当前操作。
|
|
136
|
+
设置面板支持键盘操作:使用 `Tab` 移动焦点,方向键调整滑块或选项,空格键确认按钮和开关。
|
|
113
137
|
|
|
114
138
|
## 🔌 三方插件联动
|
|
115
|
-

|
|
116
139
|
|
|
117
|
-
|
|
118
|
-
Web 插件可以直接调用本插件的服务进行流式播放。可直接在需要播放的位置写一行:
|
|
140
|
+
本插件向 Web 插件提供可选 PCM 流式播放能力:
|
|
119
141
|
|
|
120
142
|
```ts
|
|
121
143
|
ctx.get('xiaomiMimoTts')?.play('欢迎回来')
|
|
122
144
|
```
|
|
123
145
|
|
|
124
|
-
建议通过 `ctx.get()`
|
|
146
|
+
建议通过 `ctx.get()` 动态获取,不要声明为必需注入。插件未安装、未就绪或已关闭时,调用会安全跳过;新播放会中断当前朗读,`stop()` 可主动停止。
|
|
125
147
|
|
|
126
|
-
需要 TypeScript
|
|
148
|
+
需要 TypeScript 类型时:
|
|
127
149
|
|
|
128
150
|
```ts
|
|
129
151
|
import type { XiaomiMimoTtsService } from 'dsh-xiaomi-tts/client-api'
|
|
@@ -132,18 +154,20 @@ const tts = ctx.get('xiaomiMimoTts') as XiaomiMimoTtsService | undefined
|
|
|
132
154
|
tts?.play('欢迎回来')
|
|
133
155
|
```
|
|
134
156
|
|
|
135
|
-
## 🔒
|
|
157
|
+
## 🔒 隐私与网络访问
|
|
136
158
|
|
|
137
|
-
- API Key
|
|
138
|
-
-
|
|
139
|
-
-
|
|
159
|
+
- API Key 由 DSH Host 保存,浏览器只读取“是否已配置/格式是否识别”的状态,不读取密钥正文。
|
|
160
|
+
- 生成 MiMo 语音时,待朗读正文和相关音色指令会发送至 Xiaomi MiMo 服务。
|
|
161
|
+
- 浏览器本地语音由 Web Speech API 提供;标记为在线的音色可能把文本交给浏览器、操作系统或其网络语音服务。
|
|
162
|
+
- 展开设置卡片时,DSH Host 会访问 npm Registry 检查是否存在新版本。
|
|
163
|
+
- 音频在浏览器内存中通过 Web Audio 或临时 Blob URL 播放,插件不会主动持久化音频文件。
|
|
140
164
|
- 音效核心移植自 [uisfx 0.4.0](https://github.com/romainsimon/uisfx),遵循 MIT License,详见 `NOTICE`。
|
|
141
165
|
|
|
142
166
|
## 🏗️ 架构
|
|
143
167
|
|
|
144
|
-
-
|
|
145
|
-
- **Host
|
|
146
|
-
- **Web Client
|
|
168
|
+
- **共享层**:配置默认值、文本处理、分段、SSE 和播放契约。
|
|
169
|
+
- **Host 插件**:注册设置与静态资源,并代理 MiMo 完整音频和 PCM 流式请求。
|
|
170
|
+
- **Web Client**:提供设置、消息朗读、浏览器语音兜底、试听和第三方播放服务。
|
|
147
171
|
|
|
148
172
|
```mermaid
|
|
149
173
|
flowchart LR
|
|
@@ -151,40 +175,44 @@ flowchart LR
|
|
|
151
175
|
THIRD["第三方 Web 插件"] -. "ctx.get('xiaomiMimoTts')" .-> CLIENT
|
|
152
176
|
CLIENT -->|"完整音频 / PCM 流"| HOST["Host 插件<br/>设置与 API 代理"]
|
|
153
177
|
HOST --> MIMO["Xiaomi MiMo API"]
|
|
154
|
-
CLIENT -->|"
|
|
178
|
+
CLIENT -->|"Web Speech API"| SPEECH["浏览器 / 系统语音服务"]
|
|
155
179
|
SHARED["共享层<br/>配置、文本处理、SSE"] -.-> CLIENT
|
|
156
180
|
SHARED -.-> HOST
|
|
157
181
|
```
|
|
158
182
|
|
|
159
183
|
## 🛠️ 开发
|
|
160
184
|
|
|
161
|
-
修改设置面板时运行:
|
|
162
|
-
|
|
163
185
|
```bash
|
|
186
|
+
pnpm install
|
|
164
187
|
pnpm dev
|
|
165
188
|
```
|
|
166
|
-
|
|
189
|
+
|
|
190
|
+
`pnpm dev` 会启动本地 UI Lab,直接渲染 `src/client/settings/card.tsx`。设置保存、远程语音和版本检查使用本地 mock,不会调用真实 MiMo 服务。
|
|
191
|
+
|
|
192
|
+
常用检查:
|
|
167
193
|
|
|
168
194
|
```bash
|
|
169
|
-
pnpm install
|
|
170
195
|
pnpm typecheck
|
|
171
196
|
pnpm test
|
|
197
|
+
pnpm dev:build
|
|
172
198
|
pnpm pack:check
|
|
173
199
|
```
|
|
174
200
|
|
|
175
|
-
|
|
176
|
-
|
|
201
|
+
- `pnpm build`:正常构建。
|
|
202
|
+
- `pnpm build:debug`:启用 PCM 链路调试日志的构建。
|
|
203
|
+
- `pnpm profile:check`:验证本机 DSH Web profile 中的安装状态。
|
|
177
204
|
|
|
178
|
-
|
|
205
|
+
Windows 从本地开发链接切换到 npm 包前,请先停止 DSH Web,避免运行中的 Node 进程占用 Junction:
|
|
179
206
|
|
|
180
207
|
```powershell
|
|
181
|
-
.\start\dsh-plugin-reinstall.bat 3.0.
|
|
208
|
+
.\start\dsh-plugin-reinstall.bat 3.0.4-alpha
|
|
182
209
|
```
|
|
183
210
|
|
|
184
|
-
## 🤝
|
|
211
|
+
## 🤝 推荐插件
|
|
212
|
+
|
|
185
213
|
> 本插件的鲸鱼娘形象参考 `dsh-deep-whale` `dsh-whale-musume`由GPT生成。本插件的uisfx音效参考 `dsh-plugin-uisfx`实现
|
|
186
214
|
|
|
187
215
|
- [dsh-deep-whale](https://github.com/Small-tailqwq/dsh-deep-whale#readme):鲸鱼娘主题皮肤系列。
|
|
188
216
|
- [dsh-whale-musume](https://github.com/Sutera-Diffusus/dsh-whale-musume#readme):元气鲸鱼娘桌宠。
|
|
189
217
|
- [dsh-plugin-uisfx](https://github.com/XanthanL/dsh-plugin-uisfx#readme):语义化 UI 音效。
|
|
190
|
-
- [dsh-dream-skin](https://github.com/RevolutionLA/dsh-dream-skin#readme)
|
|
218
|
+
- [dsh-dream-skin](https://github.com/RevolutionLA/dsh-dream-skin#readme):原生换肤、背景壁纸、强调色和主题包。
|
|
Binary file
|
package/assets/setting.png
CHANGED
|
Binary file
|
|
Binary file
|
package/cordis.patch.yml
CHANGED
|
@@ -13,7 +13,10 @@
|
|
|
13
13
|
voiceDesignCustomPrompt: '青年女性,声线清亮、亲切自然,吐字清楚,语速适中,情绪温柔克制。'
|
|
14
14
|
presetStylePrompt: '使用清晰、自然、准确的声音朗读,语速适中,停顿自然,语气平和克制,避免夸张表达。'
|
|
15
15
|
format: 'pcm'
|
|
16
|
-
autoPlay:
|
|
16
|
+
autoPlay: false
|
|
17
|
+
soundEnabled: false
|
|
18
|
+
taskSounds: false
|
|
19
|
+
clickSounds: false
|
|
17
20
|
instruction: '请忠实朗读原文,根据文本语气自然表达,不添加或改写内容。'
|
|
18
21
|
maxTextLength: 12000
|
|
19
22
|
requestTimeoutMs: 120000
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read-aloud.d.ts","sourceRoot":"","sources":["../../../src/client/conversation/read-aloud.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,M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b;AAED,wBAAgB,eAAe,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,EAAE,EAAE,oBAAoB,GAAG,YAAY,GAAG,IAAI,CA4I5J"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAqBlD,+CAA+C;AAC/C,eAAO,MAAM,MAAM,UAMlB,CAAA;AA4BD,+EAA+E;AAC/E,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CA2FxC"}
|