mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-11-13 04:33:42 +08:00
feat: 增强音频播放管理,新增 TTSPlayManager 类,优化流式语音合成逻辑,支持 PCM 数据和 base64 转换
This commit is contained in:
@@ -1340,12 +1340,15 @@ function _Chat() {
|
||||
});
|
||||
|
||||
try {
|
||||
for await (const chunk of api.llm.streamSpeech({
|
||||
model: config.ttsConfig.model,
|
||||
input: textContent,
|
||||
voice: config.ttsConfig.voice,
|
||||
speed: config.ttsConfig.speed,
|
||||
})) {
|
||||
for await (const chunk of api.llm.streamSpeech(
|
||||
{
|
||||
model: config.ttsConfig.model,
|
||||
input: textContent,
|
||||
voice: config.ttsConfig.voice,
|
||||
speed: config.ttsConfig.speed,
|
||||
},
|
||||
ttsPlayer,
|
||||
)) {
|
||||
ttsPlayer.addToQueue(chunk);
|
||||
}
|
||||
ttsPlayer.finishStreamPlay();
|
||||
|
||||
Reference in New Issue
Block a user