feat: 重构项目以符合 Go 规范,添加 OpenAI 接口适配,优化长文本朗读功能(切割后合并)
This commit is contained in:
16
internal/models/tts.go
Normal file
16
internal/models/tts.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package models
|
||||
|
||||
// TTSRequest 表示一个语音合成请求
|
||||
type TTSRequest struct {
|
||||
Text string `json:"text"` // 要转换的文本
|
||||
Voice string `json:"voice"` // 语音ID
|
||||
Rate string `json:"rate"` // 语速 (-100% 到 +100%)
|
||||
Pitch string `json:"pitch"` // 语调 (-100% 到 +100%)
|
||||
}
|
||||
|
||||
// TTSResponse 表示一个语音合成响应
|
||||
type TTSResponse struct {
|
||||
AudioContent []byte `json:"audio_content"` // 音频数据
|
||||
ContentType string `json:"content_type"` // MIME类型
|
||||
CacheHit bool `json:"cache_hit"` // 是否命中缓存
|
||||
}
|
||||
Reference in New Issue
Block a user