diff --git a/.dockerignore b/.dockerignore index 45b0f8d..9a5c2ee 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,7 +1,8 @@ *.exe *.md .env -.env.example +.env.* +!.env.example .git .gitignore tts_api_architecture.html diff --git a/.gitignore b/.gitignore index e7ef1d8..8735742 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -# Go build cache +# Go build cache .gocache/ *.exe *.test @@ -11,4 +11,9 @@ Thumbs.db # Logs -*.log \ No newline at end of file +*.log + +# Secrets (do NOT commit local .env files; keep .env.example tracked as template) +.env +.env.* +!.env.example \ No newline at end of file diff --git a/adapter/volcano/synthesis.go b/adapter/volcano/synthesis.go index 07ccbaa..5a461da 100644 --- a/adapter/volcano/synthesis.go +++ b/adapter/volcano/synthesis.go @@ -116,7 +116,14 @@ func Synthesis( duration := time.Since(started) finalData := parsed.AudioData + // finalFormat 反映真实输出格式(用于 controller 写 Content-Type): + // - wav 走 pcm 上游 + 本地拼头,对外仍是 wav + // - aac/flac 在上方已被上游降级为 mp3,真实输出也是 mp3 + // - 其余与 clientFormat 一致 finalFormat := clientFormat + if clientFormat != "wav" { + finalFormat = opts.Format + } sampleRate := opts.SampleRate if clientFormat == "wav" { wav, wrapErr := WrapWAVHeader(parsed.AudioData, opts.SampleRate)