Spaces:
Running
Running
asemxin commited on
Commit ·
06d014e
1
Parent(s): 6adc3da
Fix segmented playback with dynamic wait time calculation
Browse files
config.js
CHANGED
|
@@ -80,7 +80,9 @@ export default {
|
|
| 80 |
// 播放当前段落
|
| 81 |
if (currentChunk) {
|
| 82 |
await engine.MiOT.doAction(7, 3, currentChunk);
|
| 83 |
-
|
|
|
|
|
|
|
| 84 |
}
|
| 85 |
currentChunk = sentence;
|
| 86 |
} else {
|
|
|
|
| 80 |
// 播放当前段落
|
| 81 |
if (currentChunk) {
|
| 82 |
await engine.MiOT.doAction(7, 3, currentChunk);
|
| 83 |
+
// 根据文字数量计算等待时间(每字约350ms)+ 1秒缓冲
|
| 84 |
+
const waitTime = currentChunk.length * 350 + 1000;
|
| 85 |
+
await new Promise(resolve => setTimeout(resolve, waitTime));
|
| 86 |
}
|
| 87 |
currentChunk = sentence;
|
| 88 |
} else {
|