Commit 13362887 by feitianbubu

fix: doubao audio speedRadio to speed

parent 412b935a
...@@ -47,7 +47,7 @@ func (a *Adaptor) ConvertAudioRequest(c *gin.Context, info *relaycommon.RelayInf ...@@ -47,7 +47,7 @@ func (a *Adaptor) ConvertAudioRequest(c *gin.Context, info *relaycommon.RelayInf
} }
voiceType := mapVoiceType(request.Voice) voiceType := mapVoiceType(request.Voice)
speedRatio := mapSpeedRatio(request.Speed) speedRatio := request.Speed
encoding := mapEncoding(request.ResponseFormat) encoding := mapEncoding(request.ResponseFormat)
c.Set("response_format", encoding) c.Set("response_format", encoding)
......
...@@ -119,20 +119,6 @@ func mapVoiceType(openAIVoice string) string { ...@@ -119,20 +119,6 @@ func mapVoiceType(openAIVoice string) string {
return openAIVoice return openAIVoice
} }
// [0.1,2],默认为 1,通常保留一位小数即可
func mapSpeedRatio(speed float64) float64 {
if speed == 0 {
return 1.0
}
if speed < 0.1 {
return 0.1
}
if speed > 2.0 {
return 2.0
}
return speed
}
func mapEncoding(responseFormat string) string { func mapEncoding(responseFormat string) string {
if encoding, ok := responseFormatToEncodingMap[responseFormat]; ok { if encoding, ok := responseFormatToEncodingMap[responseFormat]; ok {
return encoding return encoding
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment