Enable to stop TTS generation (#1041)

This commit is contained in:
Fangjun Kuang
2024-06-22 18:18:36 +08:00
committed by GitHub
parent 96ab843173
commit 9dd0e03568
32 changed files with 249 additions and 70 deletions

View File

@@ -8,8 +8,8 @@ using System;
namespace SherpaOnnx
{
// IntPtr is actuallly a `const float*` from C++
public delegate void OfflineTtsCallback(IntPtr samples, int n);
// IntPtr is actually a `const float*` from C++
public delegate int OfflineTtsCallback(IntPtr samples, int n);
public class OfflineTts : IDisposable
{
@@ -88,4 +88,4 @@ namespace SherpaOnnx
[DllImport(Dll.Filename, CallingConvention = CallingConvention.Cdecl)]
private static extern IntPtr SherpaOnnxOfflineTtsGenerateWithCallback(IntPtr handle, [MarshalAs(UnmanagedType.LPStr)] string text, int sid, float speed, OfflineTtsCallback callback);
}
}
}