feat: 长文本语音合成

This commit is contained in:
Blizzard
2026-03-06 17:39:52 +08:00
parent 2583b5f302
commit dda4d2e1d6
24 changed files with 975 additions and 52 deletions
+23
View File
@@ -144,3 +144,26 @@ func (a *ProgramApi) DeleteProgram(c *gin.Context) {
response.OkWithMsg("删除成功", c)
}
// GenerateTTS 生成TTS语音
// @Tags 节目管理
// @Summary 生成TTS语音
// @Produce json
// @Param id query string true "节目ID"
// @Success 200 {object} response.Response
// @Router /radio/program/generate-tts [get]
func (a *ProgramApi) GenerateTTS(c *gin.Context) {
id := c.Query("id")
if id == "" {
response.FailWithMsg("参数错误: id不能为空", c)
return
}
if err := programService.GenerateTTS(id); err != nil {
global.Logger.Error("生成TTS语音失败!", zap.Error(err))
response.FailWithMsg(err.Error(), c)
return
}
response.OkWithMsg("TTS生成成功", c)
}