feat: 长文本语音合成
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user