Fix typos in .Net APIs (#156)
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
|
cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
|
||||||
project(sherpa-onnx)
|
project(sherpa-onnx)
|
||||||
|
|
||||||
set(SHERPA_ONNX_VERSION "1.4.2")
|
set(SHERPA_ONNX_VERSION "1.4.3")
|
||||||
|
|
||||||
# Disable warning about
|
# Disable warning about
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ int32_t main(int32_t argc, char *argv[]) {
|
|||||||
DestroyOnlineRecognizerResult(r);
|
DestroyOnlineRecognizerResult(r);
|
||||||
|
|
||||||
DestroyDisplay(display);
|
DestroyDisplay(display);
|
||||||
DestoryOnlineStream(stream);
|
DestroyOnlineStream(stream);
|
||||||
DestroyOnlineRecognizer(recognizer);
|
DestroyOnlineRecognizer(recognizer);
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
|
|
||||||
|
|||||||
@@ -391,7 +391,7 @@ int main(int argc, char **argv) {
|
|||||||
DestroyOnlineRecognizerResult(r);
|
DestroyOnlineRecognizerResult(r);
|
||||||
|
|
||||||
DestroyDisplay(display);
|
DestroyDisplay(display);
|
||||||
DestoryOnlineStream(stream);
|
DestroyOnlineStream(stream);
|
||||||
DestroyOnlineRecognizer(recognizer);
|
DestroyOnlineRecognizer(recognizer);
|
||||||
|
|
||||||
avfilter_graph_free(&filter_graph);
|
avfilter_graph_free(&filter_graph);
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ SherpaOnnxOnlineStream *CreateOnlineStream(
|
|||||||
return stream;
|
return stream;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DestoryOnlineStream(SherpaOnnxOnlineStream *stream) { delete stream; }
|
void DestroyOnlineStream(SherpaOnnxOnlineStream *stream) { delete stream; }
|
||||||
|
|
||||||
void AcceptWaveform(SherpaOnnxOnlineStream *stream, int32_t sample_rate,
|
void AcceptWaveform(SherpaOnnxOnlineStream *stream, int32_t sample_rate,
|
||||||
const float *samples, int32_t n) {
|
const float *samples, int32_t n) {
|
||||||
@@ -222,7 +222,7 @@ SherpaOnnxOfflineStream *CreateOfflineStream(
|
|||||||
return stream;
|
return stream;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DestoryOfflineStream(SherpaOnnxOfflineStream *stream) { delete stream; }
|
void DestroyOfflineStream(SherpaOnnxOfflineStream *stream) { delete stream; }
|
||||||
|
|
||||||
void AcceptWaveformOffline(SherpaOnnxOfflineStream *stream, int32_t sample_rate,
|
void AcceptWaveformOffline(SherpaOnnxOfflineStream *stream, int32_t sample_rate,
|
||||||
const float *samples, int32_t n) {
|
const float *samples, int32_t n) {
|
||||||
|
|||||||
@@ -126,14 +126,14 @@ SHERPA_ONNX_API void DestroyOnlineRecognizer(
|
|||||||
///
|
///
|
||||||
/// @param recognizer A pointer returned by CreateOnlineRecognizer()
|
/// @param recognizer A pointer returned by CreateOnlineRecognizer()
|
||||||
/// @return Return a pointer to an OnlineStream. The user has to invoke
|
/// @return Return a pointer to an OnlineStream. The user has to invoke
|
||||||
/// DestoryOnlineStream() to free it to avoid memory leak.
|
/// DestroyOnlineStream() to free it to avoid memory leak.
|
||||||
SHERPA_ONNX_API SherpaOnnxOnlineStream *CreateOnlineStream(
|
SHERPA_ONNX_API SherpaOnnxOnlineStream *CreateOnlineStream(
|
||||||
const SherpaOnnxOnlineRecognizer *recognizer);
|
const SherpaOnnxOnlineRecognizer *recognizer);
|
||||||
|
|
||||||
/// Destroy an online stream.
|
/// Destroy an online stream.
|
||||||
///
|
///
|
||||||
/// @param stream A pointer returned by CreateOnlineStream()
|
/// @param stream A pointer returned by CreateOnlineStream()
|
||||||
SHERPA_ONNX_API void DestoryOnlineStream(SherpaOnnxOnlineStream *stream);
|
SHERPA_ONNX_API void DestroyOnlineStream(SherpaOnnxOnlineStream *stream);
|
||||||
|
|
||||||
/// Accept input audio samples and compute the features.
|
/// Accept input audio samples and compute the features.
|
||||||
/// The user has to invoke DecodeOnlineStream() to run the neural network and
|
/// 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()
|
/// @param recognizer A pointer returned by CreateOfflineRecognizer()
|
||||||
/// @return Return a pointer to an OfflineStream. The user has to invoke
|
/// @return Return a pointer to an OfflineStream. The user has to invoke
|
||||||
/// DestoryOfflineStream() to free it to avoid memory leak.
|
/// DestroyOfflineStream() to free it to avoid memory leak.
|
||||||
SHERPA_ONNX_API SherpaOnnxOfflineStream *CreateOfflineStream(
|
SHERPA_ONNX_API SherpaOnnxOfflineStream *CreateOfflineStream(
|
||||||
const SherpaOnnxOfflineRecognizer *recognizer);
|
const SherpaOnnxOfflineRecognizer *recognizer);
|
||||||
|
|
||||||
/// Destroy an offline stream.
|
/// Destroy an offline stream.
|
||||||
///
|
///
|
||||||
/// @param stream A pointer returned by CreateOfflineStream()
|
/// @param stream A pointer returned by CreateOfflineStream()
|
||||||
SHERPA_ONNX_API void DestoryOfflineStream(SherpaOnnxOfflineStream *stream);
|
SHERPA_ONNX_API void DestroyOfflineStream(SherpaOnnxOfflineStream *stream);
|
||||||
|
|
||||||
/// Accept input audio samples and compute the features.
|
/// Accept input audio samples and compute the features.
|
||||||
/// The user has to invoke DecodeOfflineStream() to run the neural network and
|
/// The user has to invoke DecodeOfflineStream() to run the neural network and
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ func sherpaOnnxOnlineTransducerModelConfig(
|
|||||||
tokens: String,
|
tokens: String,
|
||||||
numThreads: Int = 2,
|
numThreads: Int = 2,
|
||||||
debug: Int = 0
|
debug: Int = 0
|
||||||
) -> SherpaOnnxOnlineTransducerModelConfig{
|
) -> SherpaOnnxOnlineTransducerModelConfig {
|
||||||
return SherpaOnnxOnlineTransducerModelConfig(
|
return SherpaOnnxOnlineTransducerModelConfig(
|
||||||
encoder: toCPointer(encoder),
|
encoder: toCPointer(encoder),
|
||||||
decoder: toCPointer(decoder),
|
decoder: toCPointer(decoder),
|
||||||
@@ -57,15 +57,15 @@ func sherpaOnnxFeatureConfig(
|
|||||||
}
|
}
|
||||||
|
|
||||||
func sherpaOnnxOnlineRecognizerConfig(
|
func sherpaOnnxOnlineRecognizerConfig(
|
||||||
featConfig: SherpaOnnxFeatureConfig,
|
featConfig: SherpaOnnxFeatureConfig,
|
||||||
modelConfig: SherpaOnnxOnlineTransducerModelConfig,
|
modelConfig: SherpaOnnxOnlineTransducerModelConfig,
|
||||||
enableEndpoint: Bool = false,
|
enableEndpoint: Bool = false,
|
||||||
rule1MinTrailingSilence: Float = 2.4,
|
rule1MinTrailingSilence: Float = 2.4,
|
||||||
rule2MinTrailingSilence: Float = 1.2,
|
rule2MinTrailingSilence: Float = 1.2,
|
||||||
rule3MinUtteranceLength: Float = 30,
|
rule3MinUtteranceLength: Float = 30,
|
||||||
decodingMethod: String = "greedy_search",
|
decodingMethod: String = "greedy_search",
|
||||||
maxActivePaths: Int = 4
|
maxActivePaths: Int = 4
|
||||||
) -> SherpaOnnxOnlineRecognizerConfig{
|
) -> SherpaOnnxOnlineRecognizerConfig {
|
||||||
return SherpaOnnxOnlineRecognizerConfig(
|
return SherpaOnnxOnlineRecognizerConfig(
|
||||||
feat_config: featConfig,
|
feat_config: featConfig,
|
||||||
model_config: modelConfig,
|
model_config: modelConfig,
|
||||||
@@ -121,7 +121,7 @@ class SherpaOnnxRecognizer {
|
|||||||
|
|
||||||
deinit {
|
deinit {
|
||||||
if let stream {
|
if let stream {
|
||||||
DestoryOnlineStream(stream)
|
DestroyOnlineStream(stream)
|
||||||
}
|
}
|
||||||
|
|
||||||
if let recognizer {
|
if let recognizer {
|
||||||
@@ -152,7 +152,8 @@ class SherpaOnnxRecognizer {
|
|||||||
|
|
||||||
/// Get the decoding results so far
|
/// Get the decoding results so far
|
||||||
func getResult() -> SherpaOnnxOnlineRecongitionResult {
|
func getResult() -> SherpaOnnxOnlineRecongitionResult {
|
||||||
let result: UnsafeMutablePointer<SherpaOnnxOnlineRecognizerResult>? = GetOnlineStreamResult(recognizer, stream)
|
let result: UnsafeMutablePointer<SherpaOnnxOnlineRecognizerResult>? = GetOnlineStreamResult(
|
||||||
|
recognizer, stream)
|
||||||
return SherpaOnnxOnlineRecongitionResult(result: result)
|
return SherpaOnnxOnlineRecongitionResult(result: result)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user