Skip to content

Commit

Permalink
#67: replace file:// in name path, have a more descriptive log
Browse files Browse the repository at this point in the history
  • Loading branch information
ShristiC committed Nov 12, 2024
1 parent 9e4ac88 commit 355c689
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ios/VoskModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 355c689

Please sign in to comment.