mirror of
https://github.com/k2-fsa/sherpa-onnx.git
synced 2026-11-10 21:11:03 +08:00
This pull request expands the C# API by integrating Supertonic Text-to-Speech (TTS) functionality. It provides C# developers with the ability to perform text-to-speech synthesis using the Supertonic model, complete with a runnable example and necessary updates to the build and test infrastructure.
39 lines
1.2 KiB
C#
39 lines
1.2 KiB
C#
/// Copyright (c) 2024.5 by 东风破
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace SherpaOnnx
|
|
{
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
public struct OfflineTtsModelConfig
|
|
{
|
|
public OfflineTtsModelConfig()
|
|
{
|
|
Vits = new OfflineTtsVitsModelConfig();
|
|
Matcha = new OfflineTtsMatchaModelConfig();
|
|
Kokoro = new OfflineTtsKokoroModelConfig();
|
|
Kitten = new OfflineTtsKittenModelConfig();
|
|
ZipVoice = new OfflineTtsZipVoiceModelConfig();
|
|
Pocket = new OfflineTtsPocketModelConfig();
|
|
Supertonic = new OfflineTtsSupertonicModelConfig();
|
|
NumThreads = 1;
|
|
Debug = 0;
|
|
Provider = "cpu";
|
|
}
|
|
|
|
public OfflineTtsVitsModelConfig Vits;
|
|
public int NumThreads;
|
|
public int Debug;
|
|
|
|
[MarshalAs(UnmanagedType.LPStr)]
|
|
public string Provider;
|
|
|
|
public OfflineTtsMatchaModelConfig Matcha;
|
|
public OfflineTtsKokoroModelConfig Kokoro;
|
|
public OfflineTtsKittenModelConfig Kitten;
|
|
public OfflineTtsZipVoiceModelConfig ZipVoice;
|
|
public OfflineTtsPocketModelConfig Pocket;
|
|
public OfflineTtsSupertonicModelConfig Supertonic;
|
|
}
|
|
}
|