From 4e756daa1011962ed8c63716a4d207b77ccbd2e0 Mon Sep 17 00:00:00 2001 From: Shristi Chitlangia Date: Tue, 12 Nov 2024 11:40:41 -0500 Subject: [PATCH] #67: replace file:// in name path, have a more descriptive log (#79) --- ios/VoskModel.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ios/VoskModel.swift b/ios/VoskModel.swift index 3ce43fd..d547168 100644 --- a/ios/VoskModel.swift +++ b/ios/VoskModel.swift @@ -20,11 +20,12 @@ public final class VoskModel { let appBundle = Bundle(for: Self.self) + let name = name.replacingOccurrences(of: "file://", with: "") if let loadedModel = vosk_model_new(name) { print("Model successfully loaded from path.") model = loadedModel } else { - print("Model directory does not exist at path: \(name)") + print("Model directory does not exist at path: \(name). Attempt to load model from main app bundle.") // Load model from main app bundle if let resourcePath = Bundle.main.resourcePath { let modelPath = resourcePath + "/" + name