|
@@ -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)
|
|
@@ -75,6 +75,13 @@ func (a *Adaptor) ConvertAudioRequest(c *gin.Context, info *relaycommon.RelayInf
|
|
|
},
|
|
},
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 同步扩展字段的厂商自定义metadata
|
|
|
|
|
+ if len(request.Metadata) > 0 {
|
|
|
|
|
+ if err = json.Unmarshal(request.Metadata, &volcRequest); err != nil {
|
|
|
|
|
+ return nil, fmt.Errorf("error unmarshalling metadata to volcengine request: %w", err)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
jsonData, err := json.Marshal(volcRequest)
|
|
jsonData, err := json.Marshal(volcRequest)
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
return nil, fmt.Errorf("error marshalling volcengine request: %w", err)
|
|
return nil, fmt.Errorf("error marshalling volcengine request: %w", err)
|