Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Sources/FluidAudioCLI/Commands/TTSAsrVerifyCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
9 changes: 8 additions & 1 deletion Sources/FluidAudioCLI/Commands/TtsBenchmarkCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -567,6 +570,7 @@ public enum TtsBenchmarkCommand {
outputJson: outputJson,
audioDir: audioDir,
asrChoice: asrChoice,
normalizeWavs: true,
extraSummary: [
"reference": referenceURL.path,
"alpha": Double(StyleTTS2Constants.defaultAlpha),
Expand Down Expand Up @@ -659,6 +663,7 @@ public enum TtsBenchmarkCommand {
outputJson: outputJson,
audioDir: audioDir,
asrChoice: asrChoice,
normalizeWavs: true,
extraSummary: [
"voice_style": style.name,
"language": language,
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down
Loading