Add C# API for Kokoro TTS models (#1720)

This commit is contained in:
Fangjun Kuang
2025-01-16 16:30:10 +08:00
committed by GitHub
parent 2d0869c709
commit cc812e6237
11 changed files with 381 additions and 2 deletions

View File

@@ -0,0 +1,33 @@
/// Copyright (c) 2025 Xiaomi Corporation (authors: Fangjun Kuang)
using System.Runtime.InteropServices;
namespace SherpaOnnx
{
[StructLayout(LayoutKind.Sequential)]
public struct OfflineTtsKokoroModelConfig
{
public OfflineTtsKokoroModelConfig()
{
Model = "";
Voices = "";
Tokens = "";
DataDir = "";
LengthScale = 1.0F;
}
[MarshalAs(UnmanagedType.LPStr)]
public string Model;
[MarshalAs(UnmanagedType.LPStr)]
public string Voices;
[MarshalAs(UnmanagedType.LPStr)]
public string Tokens;
[MarshalAs(UnmanagedType.LPStr)]
public string DataDir;
public float LengthScale;
}
}