dsh-xiaomi-tts 2.3.2 → 2.3.4
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 +198 -120
- package/README.md +193 -185
- package/assets/menu.png +0 -0
- package/assets/preset.png +0 -0
- package/assets/social.png +0 -0
- package/assets/voice-avatars/baihua.webp +0 -0
- package/assets/voice-avatars/bingtang.webp +0 -0
- package/assets/voice-avatars/chloe.webp +0 -0
- package/assets/voice-avatars/dean.webp +0 -0
- package/assets/voice-avatars/mia.webp +0 -0
- package/assets/voice-avatars/milo.webp +0 -0
- package/assets/voice-avatars/moli.webp +0 -0
- package/assets/voice-avatars/suda.webp +0 -0
- package/assets/voice-presets/energetic-girl.webp +0 -0
- package/assets/voice-presets/liang-wenfeng.webp +0 -0
- package/cordis.patch.yml +4 -1
- package/lib/client/built-in-voice-picker.d.ts +10 -0
- package/lib/client/built-in-voice-picker.d.ts.map +1 -0
- package/lib/client/conversation.d.ts.map +1 -1
- package/lib/client/live-speech-controller.d.ts +6 -0
- package/lib/client/live-speech-controller.d.ts.map +1 -1
- package/lib/client/localization.d.ts +15 -4
- package/lib/client/localization.d.ts.map +1 -1
- package/lib/client/pcm-audio-queue.d.ts +7 -0
- package/lib/client/pcm-audio-queue.d.ts.map +1 -1
- package/lib/client/playback-controller.d.ts +4 -0
- package/lib/client/playback-controller.d.ts.map +1 -1
- package/lib/client/playback-types.d.ts +1 -1
- package/lib/client/playback-types.d.ts.map +1 -1
- package/lib/client/settings-card.d.ts.map +1 -1
- package/lib/client/settings-scope.d.ts.map +1 -1
- package/lib/client/styles.d.ts +1 -1
- package/lib/client/styles.d.ts.map +1 -1
- package/lib/client/voice-design-picker.d.ts.map +1 -1
- package/lib/client.js +880 -242
- package/lib/client.js.map +1 -1
- package/lib/index.d.ts +10 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +122 -33
- package/lib/{shared-9qFFYsWe.js → shared-CIx9nBxX.js} +226 -44
- package/lib/shared.d.ts +100 -29
- package/lib/shared.d.ts.map +1 -1
- package/lib/shared.js +2 -2
- package/package.json +104 -103
package/README.en.md
CHANGED
|
@@ -1,120 +1,198 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
Install from
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
dsh plugin --profile web add
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
Install from
|
|
50
|
-
|
|
51
|
-
```bash
|
|
52
|
-
dsh plugin --profile web add
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
```powershell
|
|
66
|
-
.\start\dsh-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
##
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
1
|
+

|
|
2
|
+
|
|
3
|
+
# dsh-xiaomi-tts
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/dsh-xiaomi-tts)
|
|
6
|
+
[](https://github.com/ppy-web/dsh-plugin-xiaomi-mimo-tts)
|
|
7
|
+
|
|
8
|
+
<p><a href="README.md"><strong>中文说明 →</strong></a></p>
|
|
9
|
+
|
|
10
|
+
Add Xiaomi MiMo TTS read-aloud playback to assistant replies in DeepSeek Harness Web.
|
|
11
|
+
|
|
12
|
+
> 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.
|
|
13
|
+
|
|
14
|
+
## Preview
|
|
15
|
+
|
|
16
|
+

|
|
17
|
+
|
|
18
|
+

|
|
19
|
+
|
|
20
|
+

|
|
21
|
+
|
|
22
|
+
## Features
|
|
23
|
+
|
|
24
|
+
- Shows a read-aloud button below each completed assistant reply body when needed; enabled by default.
|
|
25
|
+
- Uses Xiaomi MiMo's currently limited-time-free TTS models: `mimo-v2.5-tts` outputs smooth, clear audio with selectable PCM streaming or complete MP3/WAV playback.
|
|
26
|
+
- Uses `mimo-v2.5-tts-voicedesign` Voice Design to create the voice you want from a text description.
|
|
27
|
+
- 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, audio format, and voice description.
|
|
28
|
+
- Presents built-in voices in a two-column selector using Xiaomi MiMo's official avatars, names, and summaries.
|
|
29
|
+
- Keeps the API key on the DSH Host. The browser sends only the reply body text to a same-origin Host route.
|
|
30
|
+
- 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.
|
|
31
|
+
- 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.
|
|
32
|
+
|
|
33
|
+
## Requirements
|
|
34
|
+
|
|
35
|
+
- `@deepseek-ai/dsh` `0.1.0-rc.7` or a compatible version
|
|
36
|
+
- Node.js 22+
|
|
37
|
+
- Xiaomi MiMo API Key
|
|
38
|
+
|
|
39
|
+
Official Xiaomi MiMo TTS API reference: <https://mimo.mi.com/static/docs/api/audio/tts.md>
|
|
40
|
+
|
|
41
|
+
## Install
|
|
42
|
+
|
|
43
|
+
Install from npm:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
dsh plugin --profile web add dsh-xiaomi-tts
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Install from a local directory:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
dsh plugin --profile web add ./dsh-plugin-xiaomi-mimo-tts
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Install from GitHub:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
dsh plugin --profile web add github:ppy-web/dsh-plugin-xiaomi-mimo-tts
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
After installation, restart `dsh web`, then open **Settings → Plugins → Plugin configuration → Xiaomi MiMo Read Aloud**, enter the API key, and save. The plugin automatically selects the endpoint from the API key prefix: `sk-` uses the standard endpoint and `tp-` uses the Token Plan-compatible endpoint.
|
|
62
|
+
|
|
63
|
+
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:
|
|
64
|
+
|
|
65
|
+
```powershell
|
|
66
|
+
.\start\dsh-plugin-reinstall.bat 2.3.4
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
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:
|
|
70
|
+
|
|
71
|
+
```powershell
|
|
72
|
+
.\start\dsh-web-stop.bat
|
|
73
|
+
dsh plugin --profile web remove dsh-xiaomi-tts
|
|
74
|
+
dsh plugin --profile web add dsh-xiaomi-tts@2.3.4
|
|
75
|
+
.\start\dsh-web-start.bat
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Configuration
|
|
79
|
+
|
|
80
|
+
Available built-in voices for `mimo-v2.5-tts`:
|
|
81
|
+
|
|
82
|
+
- Chinese female: `冰糖`, `茉莉`
|
|
83
|
+
- Chinese male: `苏打`, `白桦`
|
|
84
|
+
- English female: `Mia`, `Chloe`
|
|
85
|
+
- English male: `Milo`, `Dean`
|
|
86
|
+
|
|
87
|
+
Preset voices default to **PCM (streaming)**. A complete reply starts playing as soon as audio chunks arrive, reducing the wait, but pause and resume are unavailable; a failure before the first chunk falls back to MP3. **MP3 (complete audio)** and **WAV (complete audio)** wait for the whole file and support pause and resume. MP3 is smaller, while WAV preserves lossless audio at a larger size.
|
|
88
|
+
|
|
89
|
+
Custom voice design with `mimo-v2.5-tts-voicedesign`
|
|
90
|
+
|
|
91
|
+
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.
|
|
92
|
+
|
|
93
|
+
```text
|
|
94
|
+
Young adult woman, bright and approachable voice, clear articulation, moderate pace, gentle and restrained emotional tone.
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
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.
|
|
98
|
+
|
|
99
|
+
Browsers may block autoplay. If that happens, click the read-aloud button first.
|
|
100
|
+
|
|
101
|
+
### Speech text preprocessing
|
|
102
|
+
|
|
103
|
+
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. Only preset voices configured for PCM stream partial replies after accumulating at least 20 speakable characters. Completed replies are sent in one PCM/SSE request and play as chunks arrive. MP3 and WAV always request complete audio.
|
|
104
|
+
|
|
105
|
+
Complete-audio responses are limited to 32 MiB for MP3 and 128 MiB for WAV by default. Advanced Cordis configuration can override these limits with `maxMp3AudioBytes` and `maxWavAudioBytes`. The Host enforces the response limit before JSON parsing and Base64 decoding.
|
|
106
|
+
|
|
107
|
+
## Privacy
|
|
108
|
+
|
|
109
|
+
- The API key stays on the DSH Host and is never sent to the browser.
|
|
110
|
+
- Reply text is sent to Xiaomi MiMo when speech is generated.
|
|
111
|
+
- Audio stays in browser memory and is played through Web Audio or a temporary Blob URL; it is not persisted to disk.
|
|
112
|
+
|
|
113
|
+
## Feedback and support
|
|
114
|
+
|
|
115
|
+
Please use [GitHub Issues](https://github.com/ppy-web/dsh-plugin-xiaomi-mimo-tts/issues) for bug reports, feature requests, or feedback.
|
|
116
|
+
|
|
117
|
+
## Architecture
|
|
118
|
+
|
|
119
|
+
- `src/index.ts`: Host entry; registers Schemastery settings, both voice-asset groups, and complete-audio plus PCM/SSE synthesis routes.
|
|
120
|
+
- `src/shared.ts`: Shared Host/Client domain contracts, including settings types, defaults, text cleaning, sentence splitting, stream batching, and SSE parsing.
|
|
121
|
+
- `src/client/index.tsx`: Web Client composition entry; binds DSH services, registers slots, injects styles, and owns controller lifecycles.
|
|
122
|
+
- `src/client/conversation.tsx`: React conversation adapter; observes DSH conversation snapshots and renders read-aloud actions.
|
|
123
|
+
- `src/client/settings-card.tsx`, `built-in-voice-picker.tsx`, and `voice-design-picker.tsx`: Plugin settings form, official built-in voice panel, and Voice Design voice selector UI.
|
|
124
|
+
- `src/client/live-speech-controller.ts`, `pcm-audio-queue.ts`, and `playback-controller.ts`: Realtime speech state machine, Web Audio PCM scheduling, and complete-audio playback.
|
|
125
|
+
- `src/client/settings-scope.ts`: Connects the DSH Settings Scope to React safely with `useSyncExternalStore`.
|
|
126
|
+
|
|
127
|
+
```mermaid
|
|
128
|
+
flowchart TD
|
|
129
|
+
DSH["DeepSeek Harness"]
|
|
130
|
+
|
|
131
|
+
subgraph Host["Host plugin"]
|
|
132
|
+
HI["src/index.ts<br/>Settings and routes"]
|
|
133
|
+
SETTINGS["DSH Settings"]
|
|
134
|
+
ROUTES["Complete audio / PCM SSE routes"]
|
|
135
|
+
ASSETS["Voice assets"]
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
subgraph Shared["Shared domain layer"]
|
|
139
|
+
SH["src/shared.ts<br/>Settings, text processing, sentence splitting, and SSE"]
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
subgraph Client["Web Client"]
|
|
143
|
+
ENTRY["client/index.tsx<br/>Composition entry"]
|
|
144
|
+
LOCALE["localization.ts"]
|
|
145
|
+
STYLE["styles.ts"]
|
|
146
|
+
SCOPE["settings-scope.ts<br/>useSyncExternalStore"]
|
|
147
|
+
FORM["settings-card.tsx"]
|
|
148
|
+
BUILTIN["built-in-voice-picker.tsx"]
|
|
149
|
+
PICKER["voice-design-picker.tsx"]
|
|
150
|
+
CONV["conversation.tsx<br/>Conversation observer and read-aloud button"]
|
|
151
|
+
|
|
152
|
+
subgraph Audio["Audio runtime"]
|
|
153
|
+
LIVE["live-speech-controller.ts<br/>Realtime speech state machine"]
|
|
154
|
+
PCM["pcm-audio-queue.ts<br/>Web Audio PCM scheduling"]
|
|
155
|
+
COMPLETE["playback-controller.ts<br/>Complete-audio playback"]
|
|
156
|
+
end
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
API["Xiaomi MiMo API"]
|
|
160
|
+
|
|
161
|
+
DSH --> HI
|
|
162
|
+
DSH --> ENTRY
|
|
163
|
+
SH --> HI
|
|
164
|
+
SH --> SCOPE
|
|
165
|
+
SH --> CONV
|
|
166
|
+
SH --> LIVE
|
|
167
|
+
HI --> SETTINGS
|
|
168
|
+
HI --> ROUTES
|
|
169
|
+
HI --> ASSETS
|
|
170
|
+
ROUTES --> API
|
|
171
|
+
ENTRY --> LOCALE
|
|
172
|
+
ENTRY --> STYLE
|
|
173
|
+
ENTRY --> SCOPE
|
|
174
|
+
ENTRY --> FORM
|
|
175
|
+
ENTRY --> CONV
|
|
176
|
+
FORM --> BUILTIN
|
|
177
|
+
FORM --> PICKER
|
|
178
|
+
CONV --> LIVE
|
|
179
|
+
CONV --> COMPLETE
|
|
180
|
+
LIVE --> PCM
|
|
181
|
+
LIVE --> ROUTES
|
|
182
|
+
COMPLETE --> ROUTES
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## Development
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
pnpm install
|
|
189
|
+
pnpm typecheck
|
|
190
|
+
pnpm test
|
|
191
|
+
pnpm pack:check
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
`lib/` is generated output and is not committed during day-to-day development. Feature commits update source and tests only; when a version is packaged or published, `prepack` regenerates the release output. GitHub installs build it during installation through `prepare`.
|
|
195
|
+
|
|
196
|
+
## License
|
|
197
|
+
|
|
198
|
+
MIT
|