1. 新增BYTEDANCE_TTS_MODEL环境变量支持,为火山TTS v3 API配置子模型版本 2. 为复刻音色添加默认兜底模型,修复55000000报错问题 3. 更新文档说明v3 API调用规则与环境变量配置 4. 修正语速转换的范围限制,匹配官方文档规范
42 lines
1010 B
Go
42 lines
1010 B
Go
package dto
|
|
|
|
import "time"
|
|
|
|
type OpenAITTSRequest struct {
|
|
Model string `json:"model"`
|
|
Input string `json:"input"`
|
|
Voice string `json:"voice"`
|
|
ResponseFormat string `json:"response_format,omitempty"`
|
|
Speed float64 `json:"speed,omitempty"`
|
|
}
|
|
|
|
type V3TTSResponse struct {
|
|
ReqID string `json:"reqid"`
|
|
Code int `json:"code"`
|
|
Message string `json:"message"`
|
|
Event string `json:"event"`
|
|
Sequence int `json:"sequence"`
|
|
Data string `json:"data"`
|
|
Sentence string `json:"sentence,omitempty"`
|
|
IsFinal bool `json:"is_final"`
|
|
Usage *V3Usage `json:"usage,omitempty"`
|
|
}
|
|
|
|
type V3Usage struct {
|
|
TextWords int `json:"text_words"`
|
|
}
|
|
|
|
type ByteDanceTTSConfig struct {
|
|
ApiKey string
|
|
ResourceId string
|
|
Speaker string
|
|
Model string // v3 声音复刻/语音大模型 子模型版本,复刻音色必填
|
|
URL string
|
|
Timeout time.Duration
|
|
}
|
|
|
|
type SynthesisResult struct {
|
|
AudioData []byte
|
|
ReqID string
|
|
}
|