feat: increase server timeout settings and max concurrent TTS requests

This commit is contained in:
王锦强
2025-03-16 21:58:48 +08:00
parent 263754d9c5
commit 1cc4ef556c
2 changed files with 4 additions and 16 deletions

View File

@@ -1,7 +1,7 @@
server:
port: 8080
read_timeout: 30
write_timeout: 30
read_timeout: 60
write_timeout: 60
base_path: ""
tts:
@@ -12,7 +12,7 @@ tts:
default_format: "audio-24khz-48kbitrate-mono-mp3"
max_text_length: 65535
request_timeout: 30
max_concurrent: 10
max_concurrent: 20
segment_threshold: 300
min_sentence_length: 200
max_sentence_length: 300

View File

@@ -450,18 +450,6 @@ func (h *TTSHandler) handleSegmentedTTS(c *gin.Context, req models.TTSRequest) {
totalTime, splitTime, synthesisTime, writeTime, formatFileSize(len(audioData)))
}
// sentenceEnders 定义句子结束的标点符号
var sentenceEnders = map[rune]bool{
'。': true,
'': true,
'': true,
'…': true,
'.': true,
'!': true,
'?': true,
'\n': true,
}
// splitTextBySentences 将文本按句子分割
func splitTextBySentences(text string) []string {
// 如果文本过短,直接作为一个句子返回