Skip to content

Commit 2cbd059

Browse files
committed
debugging ram spike
1 parent 0af6b45 commit 2cbd059

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Sources/FluidAudio/TextToSpeech/Kokoro/Assets/Lexicon/EspeakG2P.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,24 @@ final class EspeakG2P {
7070

7171
private static func frameworkBundledDataPath() -> URL? {
7272
// Try to find espeak-ng-data.bundle in all loaded bundles
73+
let logger = AppLogger(subsystem: "com.fluidaudio.tts", category: "EspeakG2P")
74+
7375
for bundle in Bundle.allBundles {
7476
if let bundleURL = bundle.url(forResource: "espeak-ng-data", withExtension: "bundle") {
7577
let dataDir = bundleURL.appendingPathComponent("espeak-ng-data")
7678
let voicesPath = dataDir.appendingPathComponent("voices")
7779

7880
if FileManager.default.fileExists(atPath: voicesPath.path) {
81+
logger.info("Found eSpeak data bundle at: \(dataDir.path)")
7982
return dataDir
83+
} else {
84+
logger.warning("Found espeak-ng-data.bundle but voices directory missing at: \(voicesPath.path)")
8085
}
8186
}
8287
}
8388

89+
logger.error(
90+
"Could not find espeak-ng-data.bundle in any loaded bundle. Searched \(Bundle.allBundles.count) bundles.")
8491
return nil
8592
}
8693

0 commit comments

Comments
 (0)