Refactor C API to prefix each API with SherpaOnnx. (#1171)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user