Refactor C API to prefix each API with SherpaOnnx. (#1171)

This commit is contained in:
Fangjun Kuang
2024-07-26 18:47:02 +08:00
committed by GitHub
parent 994c3e7c96
commit 4e6aeff07e
47 changed files with 667 additions and 618 deletions

View File

@@ -16,12 +16,12 @@ namespace SherpaOnnx
public void AcceptWaveform(int sampleRate, float[] samples)
{
AcceptWaveform(Handle, sampleRate, samples, samples.Length);
SherpaOnnxOnlineStreamAcceptWaveform(Handle, sampleRate, samples, samples.Length);
}
public void InputFinished()
{
InputFinished(Handle);
SherpaOnnxOnlineStreamInputFinished(Handle);
}
~OnlineStream()
@@ -39,7 +39,7 @@ namespace SherpaOnnx
private void Cleanup()
{
DestroyOnlineStream(Handle);
SherpaOnnxDestroyOnlineStream(Handle);
// Don't permit the handle to be used again.
_handle = new HandleRef(this, IntPtr.Zero);
@@ -49,13 +49,13 @@ namespace SherpaOnnx
public IntPtr Handle => _handle.Handle;
[DllImport(Dll.Filename)]
private static extern void DestroyOnlineStream(IntPtr handle);
private static extern void SherpaOnnxDestroyOnlineStream(IntPtr handle);
[DllImport(Dll.Filename)]
private static extern void AcceptWaveform(IntPtr handle, int sampleRate, float[] samples, int n);
private static extern void SherpaOnnxOnlineStreamAcceptWaveform(IntPtr handle, int sampleRate, float[] samples, int n);
[DllImport(Dll.Filename)]
private static extern void InputFinished(IntPtr handle);
private static extern void SherpaOnnxOnlineStreamInputFinished(IntPtr handle);
}
}