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
2023-05-14 22:32:01 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2023-05-14 22:32:01 +0800
Commit
959f13eac83a1d9dbcf1210ba4c15aba3c9cc24e
959f13ea
1 parent
b8fbf8e5
Fix typos in .Net APIs (#156)
显示空白字符变更
内嵌
并排对比
正在显示
6 个修改的文件
包含
14 行增加
和
13 行删除
CMakeLists.txt
c-api-examples/decode-file-c-api.c
ffmpeg-examples/sherpa-onnx-ffmpeg.c
sherpa-onnx/c-api/c-api.cc
sherpa-onnx/c-api/c-api.h
swift-api-examples/SherpaOnnx.swift
CMakeLists.txt
查看文件 @
959f13e
cmake_minimum_required
(
VERSION 3.13 FATAL_ERROR
)
project
(
sherpa-onnx
)
set
(
SHERPA_ONNX_VERSION
"1.4.
2
"
)
set
(
SHERPA_ONNX_VERSION
"1.4.
3
"
)
# Disable warning about
#
...
...
c-api-examples/decode-file-c-api.c
查看文件 @
959f13e
...
...
@@ -132,7 +132,7 @@ int32_t main(int32_t argc, char *argv[]) {
DestroyOnlineRecognizerResult
(
r
);
DestroyDisplay
(
display
);
Dest
or
yOnlineStream
(
stream
);
Dest
ro
yOnlineStream
(
stream
);
DestroyOnlineRecognizer
(
recognizer
);
fprintf
(
stderr
,
"
\n
"
);
...
...
ffmpeg-examples/sherpa-onnx-ffmpeg.c
查看文件 @
959f13e
...
...
@@ -391,7 +391,7 @@ int main(int argc, char **argv) {
DestroyOnlineRecognizerResult
(
r
);
DestroyDisplay
(
display
);
Dest
or
yOnlineStream
(
stream
);
Dest
ro
yOnlineStream
(
stream
);
DestroyOnlineRecognizer
(
recognizer
);
avfilter_graph_free
(
&
filter_graph
);
...
...
sherpa-onnx/c-api/c-api.cc
查看文件 @
959f13e
...
...
@@ -80,7 +80,7 @@ SherpaOnnxOnlineStream *CreateOnlineStream(
return
stream
;
}
void
Dest
or
yOnlineStream
(
SherpaOnnxOnlineStream
*
stream
)
{
delete
stream
;
}
void
Dest
ro
yOnlineStream
(
SherpaOnnxOnlineStream
*
stream
)
{
delete
stream
;
}
void
AcceptWaveform
(
SherpaOnnxOnlineStream
*
stream
,
int32_t
sample_rate
,
const
float
*
samples
,
int32_t
n
)
{
...
...
@@ -222,7 +222,7 @@ SherpaOnnxOfflineStream *CreateOfflineStream(
return
stream
;
}
void
Dest
or
yOfflineStream
(
SherpaOnnxOfflineStream
*
stream
)
{
delete
stream
;
}
void
Dest
ro
yOfflineStream
(
SherpaOnnxOfflineStream
*
stream
)
{
delete
stream
;
}
void
AcceptWaveformOffline
(
SherpaOnnxOfflineStream
*
stream
,
int32_t
sample_rate
,
const
float
*
samples
,
int32_t
n
)
{
...
...
sherpa-onnx/c-api/c-api.h
查看文件 @
959f13e
...
...
@@ -126,14 +126,14 @@ SHERPA_ONNX_API void DestroyOnlineRecognizer(
///
/// @param recognizer A pointer returned by CreateOnlineRecognizer()
/// @return Return a pointer to an OnlineStream. The user has to invoke
/// Dest
or
yOnlineStream() to free it to avoid memory leak.
/// Dest
ro
yOnlineStream() to free it to avoid memory leak.
SHERPA_ONNX_API
SherpaOnnxOnlineStream
*
CreateOnlineStream
(
const
SherpaOnnxOnlineRecognizer
*
recognizer
);
/// Destroy an online stream.
///
/// @param stream A pointer returned by CreateOnlineStream()
SHERPA_ONNX_API
void
Dest
or
yOnlineStream
(
SherpaOnnxOnlineStream
*
stream
);
SHERPA_ONNX_API
void
Dest
ro
yOnlineStream
(
SherpaOnnxOnlineStream
*
stream
);
/// Accept input audio samples and compute the features.
/// The user has to invoke DecodeOnlineStream() to run the neural network and
...
...
@@ -303,14 +303,14 @@ SHERPA_ONNX_API void DestroyOfflineRecognizer(
///
/// @param recognizer A pointer returned by CreateOfflineRecognizer()
/// @return Return a pointer to an OfflineStream. The user has to invoke
/// Dest
or
yOfflineStream() to free it to avoid memory leak.
/// Dest
ro
yOfflineStream() to free it to avoid memory leak.
SHERPA_ONNX_API
SherpaOnnxOfflineStream
*
CreateOfflineStream
(
const
SherpaOnnxOfflineRecognizer
*
recognizer
);
/// Destroy an offline stream.
///
/// @param stream A pointer returned by CreateOfflineStream()
SHERPA_ONNX_API
void
Dest
or
yOfflineStream
(
SherpaOnnxOfflineStream
*
stream
);
SHERPA_ONNX_API
void
Dest
ro
yOfflineStream
(
SherpaOnnxOfflineStream
*
stream
);
/// Accept input audio samples and compute the features.
/// The user has to invoke DecodeOfflineStream() to run the neural network and
...
...
swift-api-examples/SherpaOnnx.swift
查看文件 @
959f13e
...
...
@@ -36,7 +36,7 @@ func sherpaOnnxOnlineTransducerModelConfig(
tokens
:
String
,
numThreads
:
Int
=
2
,
debug
:
Int
=
0
)
->
SherpaOnnxOnlineTransducerModelConfig
{
)
->
SherpaOnnxOnlineTransducerModelConfig
{
return
SherpaOnnxOnlineTransducerModelConfig
(
encoder
:
toCPointer
(
encoder
),
decoder
:
toCPointer
(
decoder
),
...
...
@@ -65,7 +65,7 @@ func sherpaOnnxOnlineRecognizerConfig(
rule3MinUtteranceLength
:
Float
=
30
,
decodingMethod
:
String
=
"greedy_search"
,
maxActivePaths
:
Int
=
4
)
->
SherpaOnnxOnlineRecognizerConfig
{
)
->
SherpaOnnxOnlineRecognizerConfig
{
return
SherpaOnnxOnlineRecognizerConfig
(
feat_config
:
featConfig
,
model_config
:
modelConfig
,
...
...
@@ -121,7 +121,7 @@ class SherpaOnnxRecognizer {
deinit
{
if
let
stream
{
Dest
or
yOnlineStream
(
stream
)
Dest
ro
yOnlineStream
(
stream
)
}
if
let
recognizer
{
...
...
@@ -152,7 +152,8 @@ class SherpaOnnxRecognizer {
/// Get the decoding results so far
func
getResult
()
->
SherpaOnnxOnlineRecongitionResult
{
let
result
:
UnsafeMutablePointer
<
SherpaOnnxOnlineRecognizerResult
>
?
=
GetOnlineStreamResult
(
recognizer
,
stream
)
let
result
:
UnsafeMutablePointer
<
SherpaOnnxOnlineRecognizerResult
>
?
=
GetOnlineStreamResult
(
recognizer
,
stream
)
return
SherpaOnnxOnlineRecongitionResult
(
result
:
result
)
}
...
...
请
注册
或
登录
后发表评论