diff --git a/swift-api-examples/SherpaOnnx.swift b/swift-api-examples/SherpaOnnx.swift index 8365af7db..fe9b870e7 100644 --- a/swift-api-examples/SherpaOnnx.swift +++ b/swift-api-examples/SherpaOnnx.swift @@ -194,6 +194,19 @@ class SherpaOnnxOnlineRecongitionResult { } } + var timestamps: [Float] { + if let p = result.pointee.timestamps { + var timestamps: [Float] = [] + for index in 0..!) { self.result = result } diff --git a/swift-api-examples/decode-file.swift b/swift-api-examples/decode-file.swift index ab9bc44d6..bb71c668e 100644 --- a/swift-api-examples/decode-file.swift +++ b/swift-api-examples/decode-file.swift @@ -91,6 +91,7 @@ func run() { let result = recognizer.getResult() print("\nresult is:\n\(result.text)") + print("\nresult is:\n\(result.timestamps)") } @main