diff --git a/Sources/FluidAudioCLI/Commands/TTSAsrVerifyCommand.swift b/Sources/FluidAudioCLI/Commands/TTSAsrVerifyCommand.swift index bde8bd37..51a9d46b 100644 --- a/Sources/FluidAudioCLI/Commands/TTSAsrVerifyCommand.swift +++ b/Sources/FluidAudioCLI/Commands/TTSAsrVerifyCommand.swift @@ -146,8 +146,10 @@ public enum TTSAsrVerifyCommand { let synth0 = Date() let detailed = try await manager.synthesizeDetailed( text: phrase, voice: resolvedVoice, speed: 1.0) + // Native level — KokoroAne ships un-normalized output (#852). let wav = try AudioWAV.data( - from: detailed.samples, sampleRate: Double(detailed.sampleRate)) + from: detailed.samples, sampleRate: Double(detailed.sampleRate), + normalize: false) let synthS = Date().timeIntervalSince(synth0) // Persist WAV (audioDir if set, else temp file). diff --git a/Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift b/Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift index 484955f6..3d4d11ae 100644 --- a/Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift +++ b/Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift @@ -388,6 +388,8 @@ public enum TtsBenchmarkCommand { outputJson: outputJson, audioDir: audioDir, asrChoice: asrChoice, + // Native level — KokoroAne ships un-normalized output (#852). + normalizeWavs: false, extraSummary: ["voice": voice] ) { text in let t0 = Date() @@ -483,6 +485,7 @@ public enum TtsBenchmarkCommand { outputJson: outputJson, audioDir: audioDir, asrChoice: asrChoice, + normalizeWavs: true, extraSummary: ["voice": voice, "language": language.rawValue] ) { text in // PocketTTS is streaming-first: we measure TTFT (time to first @@ -567,6 +570,7 @@ public enum TtsBenchmarkCommand { outputJson: outputJson, audioDir: audioDir, asrChoice: asrChoice, + normalizeWavs: true, extraSummary: [ "reference": referenceURL.path, "alpha": Double(StyleTTS2Constants.defaultAlpha), @@ -659,6 +663,7 @@ public enum TtsBenchmarkCommand { outputJson: outputJson, audioDir: audioDir, asrChoice: asrChoice, + normalizeWavs: true, extraSummary: [ "voice_style": style.name, "language": language, @@ -701,6 +706,7 @@ public enum TtsBenchmarkCommand { outputJson: String?, audioDir: String?, asrChoice: AsrChoice, + normalizeWavs: Bool, extraSummary: [String: Any], synthOne: (String) async throws -> BackendPhraseSample ) async throws { @@ -738,7 +744,8 @@ public enum TtsBenchmarkCommand { .appendingPathComponent("tts-benchmark-\(UUID().uuidString).wav") } let wavData = try AudioWAV.data( - from: sample.samples, sampleRate: Double(sample.sampleRate)) + from: sample.samples, sampleRate: Double(sample.sampleRate), + normalize: normalizeWavs) try wavData.write(to: wavURL) var werValue = Double.nan