C# API for speaker diarization (#1407)
This commit is contained in:
33
scripts/dotnet/OfflineSpeakerDiarizationSegment.cs
Normal file
33
scripts/dotnet/OfflineSpeakerDiarizationSegment.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
/// Copyright (c) 2024 Xiaomi Corporation
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace SherpaOnnx
|
||||
{
|
||||
|
||||
public class OfflineSpeakerDiarizationSegment
|
||||
{
|
||||
public OfflineSpeakerDiarizationSegment(IntPtr handle)
|
||||
{
|
||||
Impl impl = (Impl)Marshal.PtrToStructure(handle, typeof(Impl));
|
||||
|
||||
Start = impl.Start;
|
||||
End = impl.End;
|
||||
Speaker = impl.Speaker;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
struct Impl
|
||||
{
|
||||
public float Start;
|
||||
public float End;
|
||||
public int Speaker;
|
||||
}
|
||||
|
||||
public float Start;
|
||||
public float End;
|
||||
public int Speaker;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user