mirror of
https://github.com/k2-fsa/sherpa-onnx.git
synced 2026-11-10 21:11:03 +08:00
This pull request enhances the C# API by introducing robust support for offline source separation. It provides new classes and configurations that enable developers to perform tasks such as vocal/accompaniment separation using both Spleeter and UVR models. The inclusion of ready-to-run examples simplifies the integration process and demonstrates the API's capabilities, making it easier for users to leverage these advanced audio processing features.
31 lines
791 B
C#
31 lines
791 B
C#
/// Copyright (c) 2026 Xiaomi Corporation (authors: Fangjun Kuang)
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace SherpaOnnx
|
|
{
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
public struct OfflineSourceSeparationModelConfig
|
|
{
|
|
public OfflineSourceSeparationModelConfig()
|
|
{
|
|
Spleeter = new OfflineSourceSeparationSpleeterModelConfig();
|
|
Uvr = new OfflineSourceSeparationUvrModelConfig();
|
|
NumThreads = 1;
|
|
Debug = 0;
|
|
Provider = "cpu";
|
|
}
|
|
|
|
public OfflineSourceSeparationSpleeterModelConfig Spleeter;
|
|
|
|
public OfflineSourceSeparationUvrModelConfig Uvr;
|
|
|
|
public int NumThreads;
|
|
|
|
public int Debug;
|
|
|
|
[MarshalAs(UnmanagedType.LPStr)]
|
|
public string Provider;
|
|
}
|
|
}
|