Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
xuning
/
sherpaonnx
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Fangjun Kuang
2024-07-12 17:39:46 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2024-07-12 17:39:46 +0800
Commit
d928f77d0e5b66e85e1f0ad8262f0c8df1f11dd9
d928f77d
1 parent
c0eaf86d
Add timestamps about streaming models for Swift API (#1113)
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
14 行增加
和
0 行删除
swift-api-examples/SherpaOnnx.swift
swift-api-examples/decode-file.swift
swift-api-examples/SherpaOnnx.swift
查看文件 @
d928f77
...
...
@@ -194,6 +194,19 @@ class SherpaOnnxOnlineRecongitionResult {
}
}
var
timestamps
:
[
Float
]
{
if
let
p
=
result
.
pointee
.
timestamps
{
var
timestamps
:
[
Float
]
=
[]
for
index
in
0
..<
count
{
timestamps
.
append
(
p
[
Int
(
index
)])
}
return
timestamps
}
else
{
let
timestamps
:
[
Float
]
=
[]
return
timestamps
}
}
init
(
result
:
UnsafePointer
<
SherpaOnnxOnlineRecognizerResult
>!
)
{
self
.
result
=
result
}
...
...
swift-api-examples/decode-file.swift
查看文件 @
d928f77
...
...
@@ -91,6 +91,7 @@ func run() {
let
result
=
recognizer
.
getResult
()
print
(
"
\n
result is:
\n\(
result
.
text
)
"
)
print
(
"
\n
result is:
\n\(
result
.
timestamps
)
"
)
}
@main
...
...
请
注册
或
登录
后发表评论