dsh-xiaomi-tts 3.0.2 → 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 -76
- package/README.md +101 -68
- package/assets/audio/auto-off03.mp3 +0 -0
- package/assets/setting.png +0 -0
- package/assets/ui/sound-effects-toggle-characters.webp +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 +50 -29
- package/lib/client/localization.d.ts.map +1 -1
- package/lib/client/playback/live-speech-controller.d.ts +2 -0
- package/lib/client/playback/live-speech-controller.d.ts.map +1 -1
- package/lib/client/playback/local-speech-controller.d.ts +3 -0
- package/lib/client/playback/local-speech-controller.d.ts.map +1 -1
- package/lib/client/playback/pcm-audio-queue.d.ts +2 -0
- package/lib/client/playback/pcm-audio-queue.d.ts.map +1 -1
- package/lib/client/playback/pcm-play-service.d.ts.map +1 -1
- package/lib/client/playback/playback-controller.d.ts +3 -1
- package/lib/client/playback/playback-controller.d.ts.map +1 -1
- package/lib/client/playback/preview-player.d.ts +15 -6
- package/lib/client/playback/preview-player.d.ts.map +1 -1
- package/lib/client/playback/voice-rate.d.ts +5 -0
- package/lib/client/playback/voice-rate.d.ts.map +1 -0
- 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/energy-volume-slider.d.ts +6 -2
- package/lib/client/settings/controls/energy-volume-slider.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 +8 -16
- 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/scope.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/switch-module.d.ts +3 -1
- package/lib/client/settings/switch-module.d.ts.map +1 -1
- package/lib/client/settings/types.d.ts +1 -2
- package/lib/client/settings/types.d.ts.map +1 -1
- package/lib/client/sound-effects/click-classifier.d.ts.map +1 -1
- package/lib/client/sound-effects/task-watcher.d.ts.map +1 -1
- package/lib/client/sound-effects/types.d.ts +4 -1
- package/lib/client/sound-effects/types.d.ts.map +1 -1
- package/lib/client.js +836 -614
- package/lib/client.js.map +1 -1
- package/lib/index.d.ts +4 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +28 -349
- package/lib/pcm-stream.js +1 -1
- package/lib/{shared-DDS4h0Vc.js → shared-BJGcWLzB.js} +90 -15
- package/lib/shared.d.ts +42 -16
- package/lib/shared.d.ts.map +1 -1
- package/lib/shared.js +2 -2
- package/package.json +47 -44
package/README.en.md
CHANGED
|
@@ -1,124 +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
|
-
-
|
|
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.
|
|
30
37
|
|
|
31
38
|
## 📋 Requirements
|
|
32
39
|
|
|
33
|
-
- `@deepseek-ai/dsh` `0.1.
|
|
40
|
+
- `@deepseek-ai/dsh` `0.1.6-alpha.2` (the current compatibility target)
|
|
34
41
|
- Node.js 22+
|
|
35
|
-
- Xiaomi MiMo API
|
|
42
|
+
- A Xiaomi MiMo API key for MiMo speech
|
|
36
43
|
- [Official TTS API documentation](https://mimo.mi.com/models/zh-CN/mimo-v2.5-tts)
|
|
37
44
|
|
|
38
|
-
## 🚀
|
|
45
|
+
## 🚀 Installation
|
|
39
46
|
|
|
40
|
-
|
|
47
|
+
### Install from npm (recommended)
|
|
41
48
|
|
|
42
49
|
```bash
|
|
43
|
-
dsh plugin --profile web add dsh-xiaomi-tts
|
|
50
|
+
dsh plugin --profile web add dsh-xiaomi-tts@latest
|
|
44
51
|
```
|
|
45
52
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
Open **Settings → Plugin marketplace**, search for `xiaomi-mimo-tts`, and click **Install**.
|
|
53
|
+
### Install from the plugin marketplace
|
|
49
54
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
```text
|
|
53
|
-
Install the dsh-xiaomi-tts plugin on this computer's DSH.
|
|
54
|
-
1. Prefer: dsh plugin --profile web add dsh-xiaomi-tts@latest
|
|
55
|
-
2. If that fails, try the source repository: https://github.com/ppy-web/dsh-plugin-xiaomi-mimo-tts
|
|
56
|
-
```
|
|
55
|
+
If the plugin is available in the current DSH marketplace catalog, search for `xiaomi-mimo-tts` under **Settings → Plugin marketplace**.
|
|
57
56
|
|
|
58
|
-
|
|
57
|
+
### Install from GitHub
|
|
59
58
|
|
|
60
59
|
```bash
|
|
61
60
|
dsh plugin --profile web add github:ppy-web/dsh-plugin-xiaomi-mimo-tts
|
|
62
61
|
```
|
|
63
62
|
|
|
64
|
-
|
|
63
|
+
You can also download a `.tgz` from GitHub Releases:
|
|
65
64
|
|
|
66
65
|
```powershell
|
|
67
|
-
dsh plugin --profile web add "<download-path
|
|
66
|
+
dsh plugin --profile web add "<download-path>\dsh-xiaomi-tts-<version>.tgz"
|
|
68
67
|
```
|
|
69
68
|
|
|
70
|
-
Release tarballs
|
|
69
|
+
Release tarballs include the build output and do not require `pnpm approve-builds`.
|
|
71
70
|
|
|
72
|
-
After installation, restart
|
|
71
|
+
After installation, restart the running DSH Web `web` profile, then open:
|
|
73
72
|
|
|
74
|
-
|
|
73
|
+
**Sidebar → Plugins → dsh-xiaomi-tts → Text To Speech (Xiaomi MiMo)**
|
|
75
74
|
|
|
76
|
-
|
|
75
|
+
## 🐋 First use
|
|
77
76
|
|
|
78
|
-
|
|
77
|
+
New installations start with:
|
|
79
78
|
|
|
80
|
-
|
|
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.
|
|
81
83
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
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.
|
|
85
100
|
|
|
86
101
|
## ⚙️ Configuration
|
|
87
102
|
|
|
88
|
-
|
|
103
|
+
### Official built-in voices
|
|
104
|
+
|
|
105
|
+
`mimo-v2.5-tts` currently provides:
|
|
89
106
|
|
|
90
107
|
- Chinese female: `冰糖`, `茉莉`
|
|
91
108
|
- Chinese male: `苏打`, `白桦`
|
|
92
109
|
- English female: `Mia`, `Chloe`
|
|
93
110
|
- English male: `Milo`, `Dean`
|
|
94
111
|
|
|
95
|
-
|
|
112
|
+
### Custom voices
|
|
96
113
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
Voice Design currently does not support PCM. It will be adapted when Xiaomi officially enables it.
|
|
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
|
-
|
|
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.
|
|
110
137
|
|
|
111
138
|
## 🔌 Third-party plugin integration
|
|
112
139
|
|
|
113
|
-
|
|
140
|
+
The plugin exposes an optional PCM streaming service to Web plugins:
|
|
114
141
|
|
|
115
142
|
```ts
|
|
116
143
|
ctx.get('xiaomiMimoTts')?.play('Welcome back')
|
|
117
144
|
```
|
|
118
145
|
|
|
119
|
-
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.
|
|
120
147
|
|
|
121
|
-
For TypeScript
|
|
148
|
+
For TypeScript types:
|
|
122
149
|
|
|
123
150
|
```ts
|
|
124
151
|
import type { XiaomiMimoTtsService } from 'dsh-xiaomi-tts/client-api'
|
|
@@ -127,18 +154,20 @@ const tts = ctx.get('xiaomiMimoTts') as XiaomiMimoTtsService | undefined
|
|
|
127
154
|
tts?.play('Welcome back')
|
|
128
155
|
```
|
|
129
156
|
|
|
130
|
-
## 🔒 Privacy
|
|
157
|
+
## 🔒 Privacy and network access
|
|
131
158
|
|
|
132
|
-
- The API
|
|
133
|
-
-
|
|
134
|
-
-
|
|
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.
|
|
135
164
|
- The sound core is migrated from [uisfx 0.4.0](https://github.com/romainsimon/uisfx) under the MIT License; see `NOTICE`.
|
|
136
165
|
|
|
137
166
|
## 🏗️ Architecture
|
|
138
167
|
|
|
139
|
-
- **Shared layer**:
|
|
140
|
-
- **Host plugin**:
|
|
141
|
-
- **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.
|
|
142
171
|
|
|
143
172
|
```mermaid
|
|
144
173
|
flowchart LR
|
|
@@ -146,40 +175,44 @@ flowchart LR
|
|
|
146
175
|
THIRD["Third-party Web plugin"] -. "ctx.get('xiaomiMimoTts')" .-> CLIENT
|
|
147
176
|
CLIENT -->|"Complete audio / PCM stream"| HOST["Host plugin<br/>Settings and API proxy"]
|
|
148
177
|
HOST --> MIMO["Xiaomi MiMo API"]
|
|
149
|
-
CLIENT -->|"
|
|
150
|
-
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
|
|
151
180
|
SHARED -.-> HOST
|
|
152
181
|
```
|
|
153
182
|
|
|
154
183
|
## 🛠️ Development
|
|
155
184
|
|
|
156
|
-
When editing the settings panel, run:
|
|
157
|
-
|
|
158
185
|
```bash
|
|
186
|
+
pnpm install
|
|
159
187
|
pnpm dev
|
|
160
188
|
```
|
|
161
189
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
Run the settings UI lab while editing the panel:
|
|
165
|
-
|
|
166
|
-
```bash
|
|
167
|
-
pnpm dev
|
|
168
|
-
```
|
|
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.
|
|
169
191
|
|
|
170
|
-
|
|
192
|
+
Common checks:
|
|
171
193
|
|
|
172
194
|
```bash
|
|
173
|
-
pnpm install
|
|
174
195
|
pnpm typecheck
|
|
175
196
|
pnpm test
|
|
197
|
+
pnpm dev:build
|
|
176
198
|
pnpm pack:check
|
|
177
199
|
```
|
|
178
200
|
|
|
179
|
-
|
|
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
|
|
180
212
|
|
|
181
|
-
|
|
213
|
+

|
|
182
214
|
|
|
183
|
-
- [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.
|
|
184
217
|
- [dsh-plugin-uisfx](https://github.com/XanthanL/dsh-plugin-uisfx#readme): semantic UI sound effects.
|
|
185
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,119 +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
|
-
-
|
|
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 播放服务。
|
|
33
37
|
|
|
34
38
|
## 📋 环境要求
|
|
35
39
|
|
|
36
|
-
- `@deepseek-ai/dsh` `0.1.
|
|
40
|
+
- `@deepseek-ai/dsh` `0.1.6-alpha.2`(当前兼容目标版本)
|
|
37
41
|
- Node.js 22+
|
|
38
|
-
- Xiaomi MiMo API Key
|
|
42
|
+
- 使用 MiMo 语音时需要 Xiaomi MiMo API Key
|
|
39
43
|
- [官方 TTS API 文档](https://mimo.mi.com/models/zh-CN/mimo-v2.5-tts)
|
|
40
44
|
|
|
41
|
-
## 🚀
|
|
45
|
+
## 🚀 安装
|
|
42
46
|
|
|
43
|
-
|
|
47
|
+
### 从 npm 安装(推荐)
|
|
44
48
|
|
|
45
49
|
```bash
|
|
46
|
-
dsh plugin --profile web add dsh-xiaomi-tts
|
|
50
|
+
dsh plugin --profile web add dsh-xiaomi-tts@latest
|
|
47
51
|
```
|
|
48
52
|
|
|
49
|
-
|
|
53
|
+
### 从插件市场安装
|
|
50
54
|
|
|
51
|
-
|
|
55
|
+
当前 DSH 插件市场已收录本插件,可在 **设置 → 插件市场** 中搜索 `xiaomi-mimo-tts`。
|
|
52
56
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
```text
|
|
56
|
-
帮我给此电脑上的dsh安装 dsh-xiaomi-tts 插件。
|
|
57
|
-
1. 优先通过命令安装 dsh plugin --profile web add dsh-xiaomi-tts@latest
|
|
58
|
-
2. 如果失败,请尝试源码 https://github.com/ppy-web/dsh-plugin-xiaomi-mimo-tts
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
- 从 GitHub 安装:
|
|
57
|
+
### 从 GitHub 安装
|
|
62
58
|
|
|
63
59
|
```bash
|
|
64
60
|
dsh plugin --profile web add github:ppy-web/dsh-plugin-xiaomi-mimo-tts
|
|
65
61
|
```
|
|
66
62
|
|
|
67
|
-
|
|
63
|
+
也可以下载 GitHub Release 中的 `.tgz`:
|
|
68
64
|
|
|
69
65
|
```powershell
|
|
70
66
|
dsh plugin --profile web add "<下载路径>\dsh-xiaomi-tts-<版本>.tgz"
|
|
71
67
|
```
|
|
72
68
|
|
|
73
|
-
Release
|
|
69
|
+
Release 压缩包已包含构建产物,无需执行 `pnpm approve-builds`。
|
|
70
|
+
|
|
71
|
+
安装完成后,重启正在运行的 DSH Web `web` profile,然后打开:
|
|
72
|
+
|
|
73
|
+
**侧边栏 → 插件 → dsh-xiaomi-tts → 语音朗读 (Xiaomi MiMo)**
|
|
74
|
+
|
|
75
|
+
## 🐋 首次使用
|
|
76
|
+
|
|
77
|
+
新安装的默认行为:
|
|
78
|
+
|
|
79
|
+
- 朗读按钮可用;
|
|
80
|
+
- **自动播报默认关闭**;
|
|
81
|
+
- **UI 音效默认关闭**;
|
|
82
|
+
- 未保存 API Key 时,“MiMo 优先”策略可能回退到浏览器本地语音。
|
|
83
|
+
|
|
84
|
+
推荐配置顺序:
|
|
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 音效,再次保存。
|
|
74
91
|
|
|
75
|
-
|
|
76
|
-
[获取并填写 API Key](https://platform.xiaomimimo.com/console/api-keys) 。支持标准API Key / Token Plan 专属 API key
|
|
92
|
+
> 新输入的 API Key 只有保存到 DSH Host 后才会用于 MiMo 试听。界面中的 `sk-` / `tp-` 检查只是格式识别,不代表服务端已经验证密钥有效。
|
|
77
93
|
|
|
78
|
-
|
|
94
|
+
### 更换或清除 API Key
|
|
79
95
|
|
|
80
|
-
|
|
96
|
+
- 输入新 Key 并保存,会替换当前个人设置层的密钥。
|
|
97
|
+
- 点击 **清除** 并保存,会移除当前用户层覆盖。
|
|
98
|
+
- 如果 DSH 基础配置仍提供密钥,清除个人覆盖后会恢复继承该密钥;因此该操作不等同于撤销 Xiaomi 平台上的密钥。
|
|
99
|
+
- 如需彻底失效,请同时前往 Xiaomi MiMo 控制台撤销对应 Key。
|
|
81
100
|
|
|
82
|
-
|
|
101
|
+
## ⚙️ 配置说明
|
|
83
102
|
|
|
84
|
-
|
|
103
|
+
### 官方内置音色
|
|
85
104
|
|
|
86
|
-
|
|
105
|
+
`mimo-v2.5-tts` 当前提供:
|
|
87
106
|
|
|
88
107
|
- 中文女声:`冰糖`、`茉莉`
|
|
89
108
|
- 中文男声:`苏打`、`白桦`
|
|
90
109
|
- 英文女声:`Mia`、`Chloe`
|
|
91
110
|
- 英文男声:`Milo`、`Dean`
|
|
92
111
|
|
|
93
|
-
|
|
94
|
-
选择 `MP3(完整音频)` 或 `WAV(完整音频)` 时,会等待完整文件生成后播放。MP3 体积更小,WAV 保留无损音频但体积更大。
|
|
112
|
+
### 自定义音色
|
|
95
113
|
|
|
96
|
-
|
|
114
|
+
`mimo-v2.5-tts-voicedesign` 支持从音色描述生成声音。设置面板包含预设模板,也可以手动编辑:
|
|
97
115
|
|
|
98
|
-
暂不支持PCM,待官方上线后可适配。
|
|
99
|
-
提供了常用音色描述模板;用户可以直接修改并保存描述。
|
|
100
116
|
```text
|
|
101
117
|
青年女性,声线清亮、亲切自然,吐字清楚,语速适中,情绪温柔克制。
|
|
102
118
|
```
|
|
103
119
|
|
|
104
|
-
|
|
120
|
+
音色描述支持预设模板,也可以直接手动编辑;修改后需要保存设置。
|
|
105
121
|
|
|
106
|
-
|
|
107
|
-
|
|
122
|
+
### 浏览器本地语音
|
|
123
|
+
|
|
124
|
+
- **MiMo 优先**:MiMo 在首段音频开始前失败时,尝试浏览器语音。
|
|
125
|
+
- **本地优先**:先使用浏览器语音,失败后尝试 MiMo。
|
|
126
|
+
- **关闭本地语音**:只使用 MiMo,不进行本地兜底。
|
|
127
|
+
|
|
128
|
+
浏览器音色来自 Web Speech API。是否离线、可用语言和实际声音取决于浏览器、操作系统及其语音服务。
|
|
129
|
+
|
|
130
|
+
### 朗读范围
|
|
131
|
+
|
|
132
|
+
- **智能模式**:自动播报优先朗读首个语义段;未读内容较多时可能补一句收尾提示。手动朗读播放全文。
|
|
133
|
+
- **全文模式**:自动播报和手动朗读都播放全文。
|
|
134
|
+
- **首段模式**:自动播报和手动朗读都只播放首个语义段。
|
|
135
|
+
|
|
136
|
+
设置面板支持键盘操作:使用 `Tab` 移动焦点,方向键调整滑块或选项,空格键确认按钮和开关。
|
|
108
137
|
|
|
109
138
|
## 🔌 三方插件联动
|
|
110
|
-

|
|
111
139
|
|
|
112
|
-
|
|
113
|
-
Web 插件可以直接调用本插件的服务进行流式播放。可直接在需要播放的位置写一行:
|
|
140
|
+
本插件向 Web 插件提供可选 PCM 流式播放能力:
|
|
114
141
|
|
|
115
142
|
```ts
|
|
116
143
|
ctx.get('xiaomiMimoTts')?.play('欢迎回来')
|
|
117
144
|
```
|
|
118
145
|
|
|
119
|
-
建议通过 `ctx.get()`
|
|
146
|
+
建议通过 `ctx.get()` 动态获取,不要声明为必需注入。插件未安装、未就绪或已关闭时,调用会安全跳过;新播放会中断当前朗读,`stop()` 可主动停止。
|
|
120
147
|
|
|
121
|
-
需要 TypeScript
|
|
148
|
+
需要 TypeScript 类型时:
|
|
122
149
|
|
|
123
150
|
```ts
|
|
124
151
|
import type { XiaomiMimoTtsService } from 'dsh-xiaomi-tts/client-api'
|
|
@@ -127,18 +154,20 @@ const tts = ctx.get('xiaomiMimoTts') as XiaomiMimoTtsService | undefined
|
|
|
127
154
|
tts?.play('欢迎回来')
|
|
128
155
|
```
|
|
129
156
|
|
|
130
|
-
## 🔒
|
|
157
|
+
## 🔒 隐私与网络访问
|
|
131
158
|
|
|
132
|
-
- API Key
|
|
133
|
-
-
|
|
134
|
-
-
|
|
159
|
+
- API Key 由 DSH Host 保存,浏览器只读取“是否已配置/格式是否识别”的状态,不读取密钥正文。
|
|
160
|
+
- 生成 MiMo 语音时,待朗读正文和相关音色指令会发送至 Xiaomi MiMo 服务。
|
|
161
|
+
- 浏览器本地语音由 Web Speech API 提供;标记为在线的音色可能把文本交给浏览器、操作系统或其网络语音服务。
|
|
162
|
+
- 展开设置卡片时,DSH Host 会访问 npm Registry 检查是否存在新版本。
|
|
163
|
+
- 音频在浏览器内存中通过 Web Audio 或临时 Blob URL 播放,插件不会主动持久化音频文件。
|
|
135
164
|
- 音效核心移植自 [uisfx 0.4.0](https://github.com/romainsimon/uisfx),遵循 MIT License,详见 `NOTICE`。
|
|
136
165
|
|
|
137
166
|
## 🏗️ 架构
|
|
138
167
|
|
|
139
|
-
-
|
|
140
|
-
- **Host
|
|
141
|
-
- **Web Client
|
|
168
|
+
- **共享层**:配置默认值、文本处理、分段、SSE 和播放契约。
|
|
169
|
+
- **Host 插件**:注册设置与静态资源,并代理 MiMo 完整音频和 PCM 流式请求。
|
|
170
|
+
- **Web Client**:提供设置、消息朗读、浏览器语音兜底、试听和第三方播放服务。
|
|
142
171
|
|
|
143
172
|
```mermaid
|
|
144
173
|
flowchart LR
|
|
@@ -146,40 +175,44 @@ flowchart LR
|
|
|
146
175
|
THIRD["第三方 Web 插件"] -. "ctx.get('xiaomiMimoTts')" .-> CLIENT
|
|
147
176
|
CLIENT -->|"完整音频 / PCM 流"| HOST["Host 插件<br/>设置与 API 代理"]
|
|
148
177
|
HOST --> MIMO["Xiaomi MiMo API"]
|
|
149
|
-
CLIENT -->|"
|
|
178
|
+
CLIENT -->|"Web Speech API"| SPEECH["浏览器 / 系统语音服务"]
|
|
150
179
|
SHARED["共享层<br/>配置、文本处理、SSE"] -.-> CLIENT
|
|
151
180
|
SHARED -.-> HOST
|
|
152
181
|
```
|
|
153
182
|
|
|
154
183
|
## 🛠️ 开发
|
|
155
184
|
|
|
156
|
-
修改设置面板时运行:
|
|
157
|
-
|
|
158
185
|
```bash
|
|
186
|
+
pnpm install
|
|
159
187
|
pnpm dev
|
|
160
188
|
```
|
|
161
|
-
|
|
189
|
+
|
|
190
|
+
`pnpm dev` 会启动本地 UI Lab,直接渲染 `src/client/settings/card.tsx`。设置保存、远程语音和版本检查使用本地 mock,不会调用真实 MiMo 服务。
|
|
191
|
+
|
|
192
|
+
常用检查:
|
|
162
193
|
|
|
163
194
|
```bash
|
|
164
|
-
pnpm install
|
|
165
195
|
pnpm typecheck
|
|
166
196
|
pnpm test
|
|
197
|
+
pnpm dev:build
|
|
167
198
|
pnpm pack:check
|
|
168
199
|
```
|
|
169
200
|
|
|
170
|
-
|
|
171
|
-
|
|
201
|
+
- `pnpm build`:正常构建。
|
|
202
|
+
- `pnpm build:debug`:启用 PCM 链路调试日志的构建。
|
|
203
|
+
- `pnpm profile:check`:验证本机 DSH Web profile 中的安装状态。
|
|
172
204
|
|
|
173
|
-
|
|
205
|
+
Windows 从本地开发链接切换到 npm 包前,请先停止 DSH Web,避免运行中的 Node 进程占用 Junction:
|
|
174
206
|
|
|
175
207
|
```powershell
|
|
176
|
-
.\start\dsh-plugin-reinstall.bat 3.0.
|
|
208
|
+
.\start\dsh-plugin-reinstall.bat 3.0.4-alpha
|
|
177
209
|
```
|
|
178
210
|
|
|
179
|
-
## 🤝
|
|
211
|
+
## 🤝 推荐插件
|
|
212
|
+
|
|
180
213
|
> 本插件的鲸鱼娘形象参考 `dsh-deep-whale` `dsh-whale-musume`由GPT生成。本插件的uisfx音效参考 `dsh-plugin-uisfx`实现
|
|
181
214
|
|
|
182
215
|
- [dsh-deep-whale](https://github.com/Small-tailqwq/dsh-deep-whale#readme):鲸鱼娘主题皮肤系列。
|
|
183
216
|
- [dsh-whale-musume](https://github.com/Sutera-Diffusus/dsh-whale-musume#readme):元气鲸鱼娘桌宠。
|
|
184
217
|
- [dsh-plugin-uisfx](https://github.com/XanthanL/dsh-plugin-uisfx#readme):语义化 UI 音效。
|
|
185
|
-
- [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
|
|
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,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"read-aloud.d.ts","sourceRoot":"","sources":["../../../src/client/conversation/read-aloud.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAWzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,KAAK,EAAE,YAAY,EAAkB,MAAM,wCAAwC,CAAA;AAC1F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAA;AACrF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4CAA4C,CAAA;AAC/E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAyFtG,UAAU,4BAA4B;IACpC,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,QAAQ,EAAE,eAAe,KAAK,CAAC,KAAK,CAAC,CAAA;IAChE,OAAO,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,QAAQ,EAAE,YAAY,KAAK,CAAC,KAAK,CAAC,CAAA;IAC1D,QAAQ,EAAE,kBAAkB,CAAA;IAC5B,IAAI,EAAE,oBAAoB,CAAA;IAC1B,KAAK,EAAE,qBAAqB,CAAA;IAC5B,QAAQ,EAAE,aAAa,CAAC,WAAW,CAAC,CAAA;CACrC;AAWD,kGAAkG;AAClG,wBAAgB,uBAAuB,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,4BAA4B,GAAG,IAAI,CA6G/I;AAED,UAAU,oBAAoB;IAC5B,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,QAAQ,EAAE,eAAe,KAAK,CAAC,KAAK,CAAC,CAAA;IAChE,OAAO,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,QAAQ,EAAE,YAAY,KAAK,CAAC,KAAK,CAAC,CAAA;IAC1D,QAAQ,EAAE,kBAAkB,CAAA;IAC5B,IAAI,EAAE,oBAAoB,CAAA;IAC1B,KAAK,EAAE,qBAAqB,CAAA;IAC5B,QAAQ,EAAE,aAAa,CAAC,WAAW,CAAC,CAAA;IACpC,CAAC,EAAE,SAAS,CAAA;CACb;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"}
|