@@ -132,6 +132,8 @@ func Synthesis(config *dto.ByteDanceTTSConfig, httpClient *HTTPClient, text stri
|
|||||||
if v3Resp.Usage != nil {
|
if v3Resp.Usage != nil {
|
||||||
log.Printf("TTS synthesis completed, usage: %+v", v3Resp.Usage)
|
log.Printf("TTS synthesis completed, usage: %+v", v3Resp.Usage)
|
||||||
}
|
}
|
||||||
|
for scanner.Scan() {
|
||||||
|
}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package common
|
package common
|
||||||
|
|
||||||
import "time"
|
import "time"
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,6 @@ func OpenaiTTSHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
body, err := io.ReadAll(r.Body)
|
body, err := io.ReadAll(r.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if strings.Contains(err.Error(), "request body too large") {
|
if strings.Contains(err.Error(), "request body too large") {
|
||||||
http.Error(w, fmt.Sprintf("Request body too large (max %d bytes)", common.MaxRequestBodySize), http.StatusRequestEntityTooLarge)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
http.Error(w, "Failed to read request body", http.StatusBadRequest)
|
http.Error(w, "Failed to read request body", http.StatusBadRequest)
|
||||||
|
|||||||
Reference in New Issue
Block a user