Add C# API for Moonshine models. (#1483)

* Also, return timestamps for non-streaming ASR.
This commit is contained in:
Fangjun Kuang
2024-10-27 13:14:25 +08:00
committed by GitHub
parent cdd8e1bbcb
commit 3622104133
6 changed files with 144 additions and 9 deletions

View File

@@ -0,0 +1,29 @@
/// Copyright (c) 2024 Xiaomi Corporation (authors: Fangjun Kuang)
using System.Runtime.InteropServices;
namespace SherpaOnnx
{
[StructLayout(LayoutKind.Sequential)]
public struct OfflineMoonshineModelConfig
{
public OfflineMoonshineModelConfig()
{
Preprocessor = "";
Encoder = "";
UncachedDecoder = "";
CachedDecoder = "";
}
[MarshalAs(UnmanagedType.LPStr)]
public string Preprocessor;
[MarshalAs(UnmanagedType.LPStr)]
public string Encoder;
[MarshalAs(UnmanagedType.LPStr)]
public string UncachedDecoder;
[MarshalAs(UnmanagedType.LPStr)]
public string CachedDecoder;
}
}