|
@@ -855,7 +855,7 @@ const generateVoiceover = async (lessonIndex, sectionIndex, dialogueIndex) => {
|
|
|
|
|
|
|
|
const dialogue = section.dialogues[dialogueIndex]
|
|
const dialogue = section.dialogues[dialogueIndex]
|
|
|
|
|
|
|
|
- // 只处理数字人对话和提问
|
|
|
|
|
|
|
+ // 只处理数字人对话和提问、诗词
|
|
|
if (dialogue.type === 'user') {
|
|
if (dialogue.type === 'user') {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
@@ -869,10 +869,16 @@ const generateVoiceover = async (lessonIndex, sectionIndex, dialogueIndex) => {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
try {
|
|
try {
|
|
|
|
|
+ // 根据对话类型设置不同的command
|
|
|
|
|
+ const command = dialogue.type === 'poem'
|
|
|
|
|
+ ? "要有感情的朗读诗词语句,要符合诗词的节奏和韵律。"
|
|
|
|
|
+ : null
|
|
|
|
|
+
|
|
|
// 调用后端API将文本转成语音
|
|
// 调用后端API将文本转成语音
|
|
|
const response = await textToSpeech({
|
|
const response = await textToSpeech({
|
|
|
roleId: role.id,
|
|
roleId: role.id,
|
|
|
- content: dialogue.content
|
|
|
|
|
|
|
+ content: dialogue.content,
|
|
|
|
|
+ command: command
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
// 将返回的URL赋值给对话
|
|
// 将返回的URL赋值给对话
|