Refactor .Net example project (#1049)
Co-authored-by: 东风破 <birdfishs@163.com>
This commit is contained in:
@@ -1,10 +1,7 @@
|
||||
/// Copyright (c) 2024 Xiaomi Corporation (authors: Fangjun Kuang)
|
||||
/// Copyright (c) 2024 Xiaomi Corporation (authors: Fangjun Kuang)
|
||||
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SherpaOnnx
|
||||
{
|
||||
|
||||
@@ -2,12 +2,6 @@
|
||||
/// Copyright (c) 2023 by manyeyes
|
||||
/// Copyright (c) 2024.5 by 东风破
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System;
|
||||
|
||||
namespace SherpaOnnx
|
||||
{
|
||||
internal static class Dll
|
||||
|
||||
@@ -2,11 +2,7 @@
|
||||
/// Copyright (c) 2023 by manyeyes
|
||||
/// Copyright (c) 2024.5 by 东风破
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System;
|
||||
|
||||
namespace SherpaOnnx
|
||||
{
|
||||
@@ -29,4 +25,4 @@ namespace SherpaOnnx
|
||||
public int FeatureDim;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,12 @@
|
||||
/// Copyright (c) 2023 Xiaomi Corporation (authors: Fangjun Kuang)
|
||||
/// Copyright (c) 2023 by manyeyes
|
||||
/// Copyright (c) 2024.5 by 东风破
|
||||
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System;
|
||||
|
||||
namespace SherpaOnnx
|
||||
{
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct OfflineLMConfig
|
||||
{
|
||||
@@ -21,4 +20,5 @@ namespace SherpaOnnx
|
||||
|
||||
public float Scale;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,13 +1,10 @@
|
||||
/// Copyright (c) 2024.5 by 东风破
|
||||
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System;
|
||||
|
||||
namespace SherpaOnnx
|
||||
{
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct OfflineModelConfig
|
||||
{
|
||||
@@ -55,4 +52,6 @@ namespace SherpaOnnx
|
||||
[MarshalAs(UnmanagedType.LPStr)]
|
||||
public string TeleSpeechCtc;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,13 +1,12 @@
|
||||
/// Copyright (c) 2023 Xiaomi Corporation (authors: Fangjun Kuang)
|
||||
/// Copyright (c) 2023 by manyeyes
|
||||
/// Copyright (c) 2024.5 by 东风破
|
||||
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System;
|
||||
|
||||
namespace SherpaOnnx
|
||||
{
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct OfflineNemoEncDecCtcModelConfig
|
||||
{
|
||||
@@ -18,4 +17,4 @@ namespace SherpaOnnx
|
||||
[MarshalAs(UnmanagedType.LPStr)]
|
||||
public string Model;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,6 @@
|
||||
/// Copyright (c) 2024.5 by 东风破
|
||||
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System;
|
||||
|
||||
namespace SherpaOnnx
|
||||
{
|
||||
@@ -18,4 +14,5 @@ namespace SherpaOnnx
|
||||
[MarshalAs(UnmanagedType.LPStr)]
|
||||
public string Model;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,10 +1,8 @@
|
||||
/// Copyright (c) 2024 Xiaomi Corporation (authors: Fangjun Kuang)
|
||||
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
/// Copyright (c) 2024 Xiaomi Corporation (authors: Fangjun Kuang)
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System;
|
||||
|
||||
|
||||
namespace SherpaOnnx
|
||||
{
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
/// Copyright (c) 2024 Xiaomi Corporation (authors: Fangjun Kuang)
|
||||
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System;
|
||||
|
||||
namespace SherpaOnnx
|
||||
{
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
/// Copyright (c) 2024 Xiaomi Corporation (authors: Fangjun Kuang)
|
||||
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System;
|
||||
|
||||
namespace SherpaOnnx
|
||||
{
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
/// Copyright (c) 2024.5 by 东风破
|
||||
/// Copyright (c) 2024.5 by 东风破
|
||||
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SherpaOnnx
|
||||
{
|
||||
@@ -72,4 +71,5 @@ namespace SherpaOnnx
|
||||
[DllImport(Dll.Filename, EntryPoint = "DecodeMultipleOfflineStreams")]
|
||||
private static extern void Decode(IntPtr handle, IntPtr[] streams, int n);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
/// Copyright (c) 2024.5 by 东风破
|
||||
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System;
|
||||
|
||||
namespace SherpaOnnx
|
||||
{
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct OfflineRecognizerConfig
|
||||
{
|
||||
@@ -44,4 +41,6 @@ namespace SherpaOnnx
|
||||
[MarshalAs(UnmanagedType.LPStr)]
|
||||
public string RuleFars;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,13 +1,12 @@
|
||||
/// Copyright (c) 2024.5 by 东风破
|
||||
/// Copyright (c) 2024.5 by 东风破
|
||||
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System;
|
||||
|
||||
namespace SherpaOnnx
|
||||
{
|
||||
|
||||
public class OfflineRecognizerResult
|
||||
{
|
||||
public OfflineRecognizerResult(IntPtr handle)
|
||||
@@ -43,4 +42,6 @@ namespace SherpaOnnx
|
||||
private String _text;
|
||||
public String Text => _text;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
/// Copyright (c) 2024.5 by 东风破
|
||||
/// Copyright (c) 2024.5 by 东风破
|
||||
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SherpaOnnx
|
||||
{
|
||||
|
||||
public class OfflineStream : IDisposable
|
||||
{
|
||||
public OfflineStream(IntPtr p)
|
||||
@@ -67,4 +65,5 @@ namespace SherpaOnnx
|
||||
[DllImport(Dll.Filename, EntryPoint = "DestroyOfflineRecognizerResult")]
|
||||
private static extern void DestroyResult(IntPtr handle);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
/// Copyright (c) 2024.5 by 东风破
|
||||
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System;
|
||||
|
||||
namespace SherpaOnnx
|
||||
{
|
||||
@@ -18,4 +14,5 @@ namespace SherpaOnnx
|
||||
[MarshalAs(UnmanagedType.LPStr)]
|
||||
public string Model;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,10 +1,6 @@
|
||||
/// Copyright (c) 2024.5 by 东风破
|
||||
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System;
|
||||
|
||||
namespace SherpaOnnx
|
||||
{
|
||||
@@ -26,4 +22,5 @@ namespace SherpaOnnx
|
||||
[MarshalAs(UnmanagedType.LPStr)]
|
||||
public string Joiner;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,10 +1,6 @@
|
||||
/// Copyright (c) 2024.5 by 东风破
|
||||
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
/// Copyright (c) 2024.5 by 东风破
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SherpaOnnx
|
||||
{
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
/// Copyright (c) 2024.5 by 东风破
|
||||
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System;
|
||||
|
||||
namespace SherpaOnnx
|
||||
{
|
||||
@@ -28,4 +24,5 @@ namespace SherpaOnnx
|
||||
[MarshalAs(UnmanagedType.LPStr)]
|
||||
public string RuleFars;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,10 +1,6 @@
|
||||
/// Copyright (c) 2024.5 by 东风破
|
||||
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
/// Copyright (c) 2024.5 by 东风破
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SherpaOnnx
|
||||
{
|
||||
@@ -90,4 +86,4 @@ namespace SherpaOnnx
|
||||
[DllImport(Dll.Filename)]
|
||||
private static extern int SherpaOnnxWriteWave(IntPtr samples, int n, int sample_rate, [MarshalAs(UnmanagedType.LPStr)] string filename);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
/// Copyright (c) 2024.5 by 东风破
|
||||
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System;
|
||||
|
||||
namespace SherpaOnnx
|
||||
{
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct OfflineTtsModelConfig
|
||||
{
|
||||
@@ -25,4 +22,4 @@ namespace SherpaOnnx
|
||||
[MarshalAs(UnmanagedType.LPStr)]
|
||||
public string Provider;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,6 @@
|
||||
/// Copyright (c) 2024.5 by 东风破
|
||||
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System;
|
||||
|
||||
namespace SherpaOnnx
|
||||
{
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
/// Copyright (c) 2024.5 by 东风破
|
||||
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System;
|
||||
|
||||
namespace SherpaOnnx
|
||||
{
|
||||
@@ -33,4 +29,5 @@ namespace SherpaOnnx
|
||||
|
||||
public int TailPaddings;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,11 +2,7 @@
|
||||
/// Copyright (c) 2023 by manyeyes
|
||||
/// Copyright (c) 2024.5 by 东风破
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System;
|
||||
|
||||
namespace SherpaOnnx
|
||||
{
|
||||
@@ -24,4 +20,5 @@ namespace SherpaOnnx
|
||||
|
||||
public int MaxActive;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,14 +2,11 @@
|
||||
/// Copyright (c) 2023 by manyeyes
|
||||
/// Copyright (c) 2024.5 by 东风破
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System;
|
||||
|
||||
namespace SherpaOnnx
|
||||
{
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct OnlineModelConfig
|
||||
{
|
||||
@@ -52,4 +49,5 @@ namespace SherpaOnnx
|
||||
[MarshalAs(UnmanagedType.LPStr)]
|
||||
public string BpeVocab;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,14 +2,11 @@
|
||||
/// Copyright (c) 2023 by manyeyes
|
||||
/// Copyright (c) 2024.5 by 东风破
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System;
|
||||
|
||||
namespace SherpaOnnx
|
||||
{
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct OnlineParaformerModelConfig
|
||||
{
|
||||
@@ -25,4 +22,5 @@ namespace SherpaOnnx
|
||||
[MarshalAs(UnmanagedType.LPStr)]
|
||||
public string Decoder;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,12 +1,10 @@
|
||||
/// Copyright (c) 2023 Xiaomi Corporation (authors: Fangjun Kuang)
|
||||
/// Copyright (c) 2023 Xiaomi Corporation (authors: Fangjun Kuang)
|
||||
/// Copyright (c) 2023 by manyeyes
|
||||
/// Copyright (c) 2024.5 by 东风破
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System;
|
||||
|
||||
namespace SherpaOnnx
|
||||
{
|
||||
@@ -122,4 +120,4 @@ namespace SherpaOnnx
|
||||
[DllImport(Dll.Filename)]
|
||||
private static extern int IsEndpoint(IntPtr handle, IntPtr stream);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,14 +2,11 @@
|
||||
/// Copyright (c) 2023 by manyeyes
|
||||
/// Copyright (c) 2024.5 by 东风破
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System;
|
||||
|
||||
namespace SherpaOnnx
|
||||
{
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct OnlineRecognizerConfig
|
||||
{
|
||||
@@ -73,4 +70,5 @@ namespace SherpaOnnx
|
||||
[MarshalAs(UnmanagedType.LPStr)]
|
||||
public string RuleFars;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,15 +1,13 @@
|
||||
/// Copyright (c) 2023 Xiaomi Corporation (authors: Fangjun Kuang)
|
||||
/// Copyright (c) 2023 Xiaomi Corporation (authors: Fangjun Kuang)
|
||||
/// Copyright (c) 2023 by manyeyes
|
||||
/// Copyright (c) 2024.5 by 东风破
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System;
|
||||
|
||||
namespace SherpaOnnx
|
||||
{
|
||||
|
||||
public class OnlineRecognizerResult
|
||||
{
|
||||
public OnlineRecognizerResult(IntPtr handle)
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
/// Copyright (c) 2023 Xiaomi Corporation (authors: Fangjun Kuang)
|
||||
/// Copyright (c) 2023 Xiaomi Corporation (authors: Fangjun Kuang)
|
||||
/// Copyright (c) 2023 by manyeyes
|
||||
/// Copyright (c) 2024.5 by 东风破
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SherpaOnnx
|
||||
{
|
||||
|
||||
public class OnlineStream : IDisposable
|
||||
{
|
||||
public OnlineStream(IntPtr p)
|
||||
@@ -60,4 +57,5 @@ namespace SherpaOnnx
|
||||
[DllImport(Dll.Filename)]
|
||||
private static extern void InputFinished(IntPtr handle);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,14 +2,11 @@
|
||||
/// Copyright (c) 2023 by manyeyes
|
||||
/// Copyright (c) 2024.5 by 东风破
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System;
|
||||
|
||||
namespace SherpaOnnx
|
||||
{
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct OnlineTransducerModelConfig
|
||||
{
|
||||
@@ -29,4 +26,5 @@ namespace SherpaOnnx
|
||||
[MarshalAs(UnmanagedType.LPStr)]
|
||||
public string Joiner;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,11 +2,7 @@
|
||||
/// Copyright (c) 2023 by manyeyes
|
||||
/// Copyright (c) 2024.5 by 东风破
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System;
|
||||
|
||||
namespace SherpaOnnx
|
||||
{
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
/// Copyright (c) 2024 Xiaomi Corporation (authors: Fangjun Kuang)
|
||||
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System;
|
||||
|
||||
namespace SherpaOnnx
|
||||
{
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
/// Copyright (c) 2024.5 by 东风破
|
||||
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
/// Copyright (c) 2024.5 by 东风破
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SherpaOnnx
|
||||
{
|
||||
@@ -93,4 +89,4 @@ namespace SherpaOnnx
|
||||
private static extern void SherpaOnnxSpeakerEmbeddingExtractorDestroyEmbedding(IntPtr p);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
/// Copyright (c) 2024.5 by 东风破
|
||||
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System;
|
||||
|
||||
namespace SherpaOnnx
|
||||
{
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
/// Copyright (c) 2024.5 by 东风破
|
||||
|
||||
using System.Linq;
|
||||
/// Copyright (c) 2024.5 by 东风破
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System;
|
||||
|
||||
namespace SherpaOnnx
|
||||
{
|
||||
@@ -186,4 +184,4 @@ namespace SherpaOnnx
|
||||
[DllImport(Dll.Filename)]
|
||||
private static extern void SherpaOnnxSpeakerEmbeddingManagerFreeAllSpeakers(IntPtr names);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
/// Copyright (c) 2024 Xiaomi Corporation (authors: Fangjun Kuang)
|
||||
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
/// Copyright (c) 2024 Xiaomi Corporation (authors: Fangjun Kuang)
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SherpaOnnx
|
||||
{
|
||||
public class SpeechSegment
|
||||
{
|
||||
public SpeechSegment(IntPtr handle)
|
||||
{
|
||||
public SpeechSegment(IntPtr handle)
|
||||
{
|
||||
Impl impl = (Impl)Marshal.PtrToStructure(handle, typeof(Impl));
|
||||
|
||||
_start = impl.Start;
|
||||
@@ -28,20 +24,20 @@ namespace SherpaOnnx
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int _start;
|
||||
public int Start => _start;
|
||||
public int _start;
|
||||
public int Start => _start;
|
||||
|
||||
private float[] _samples;
|
||||
public float[] Samples => _samples;
|
||||
private float[] _samples;
|
||||
public float[] Samples => _samples;
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
struct Impl
|
||||
{
|
||||
public int Start;
|
||||
public IntPtr Samples;
|
||||
public int Count;
|
||||
}
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
struct Impl
|
||||
{
|
||||
public int Start;
|
||||
public IntPtr Samples;
|
||||
public int Count;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
/// Copyright (c) 2024.5 by 东风破
|
||||
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
/// Copyright (c) 2024.5 by 东风破
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SherpaOnnx
|
||||
{
|
||||
@@ -68,4 +64,4 @@ namespace SherpaOnnx
|
||||
[DllImport(Dll.Filename)]
|
||||
private static extern void SherpaOnnxDestroySpokenLanguageIdentificationResult(IntPtr handle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
/// Copyright (c) 2024.5 by 东风破
|
||||
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System;
|
||||
|
||||
namespace SherpaOnnx
|
||||
{
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
/// Copyright (c) 2024.5 by 东风破
|
||||
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
/// Copyright (c) 2024.5 by 东风破
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System;
|
||||
|
||||
namespace SherpaOnnx
|
||||
{
|
||||
@@ -43,4 +40,4 @@ namespace SherpaOnnx
|
||||
private String _lang;
|
||||
public String Lang => _lang;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
/// Copyright (c) 2024.5 by 东风破
|
||||
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System;
|
||||
|
||||
namespace SherpaOnnx
|
||||
{
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
/// Copyright (c) 2024 Xiaomi Corporation (authors: Fangjun Kuang)
|
||||
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System;
|
||||
|
||||
namespace SherpaOnnx
|
||||
{
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
/// Copyright (c) 2024 Xiaomi Corporation (authors: Fangjun Kuang)
|
||||
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
/// Copyright (c) 2024 Xiaomi Corporation (authors: Fangjun Kuang)
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SherpaOnnx
|
||||
{
|
||||
@@ -112,4 +108,3 @@ namespace SherpaOnnx
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
12
scripts/dotnet/examples/Common.csproj
Normal file
12
scripts/dotnet/examples/Common.csproj
Normal file
@@ -0,0 +1,12 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>.net6</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CommandLineParser" Version="2.9.1" />
|
||||
<PackageReference Include="org.k2fsa.sherpa.onnx" Version="1.10.1" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -8,13 +8,8 @@
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<RestoreSources>/tmp/packages;$(RestoreSources);https://api.nuget.org/v3/index.json</RestoreSources>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CommandLineParser" Version="2.9.1" />
|
||||
<PackageReference Include="org.k2fsa.sherpa.onnx" Version="*" />
|
||||
<ProjectReference Include="..\Common\Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -1,19 +1,15 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<RootNamespace>offline_punctuation</RootNamespace>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<RestoreSources>/tmp/packages;$(RestoreSources);https://api.nuget.org/v3/index.json</RestoreSources>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="org.k2fsa.sherpa.onnx" Version="*" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<RootNamespace>offline_punctuation</RootNamespace>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Common\Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -8,14 +8,12 @@
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<RestoreSources>/tmp/packages;$(RestoreSources);https://api.nuget.org/v3/index.json</RestoreSources>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CommandLineParser" Version="2.9.1" />
|
||||
<PackageReference Include="org.k2fsa.sherpa.onnx" Version="*" />
|
||||
<PackageReference Include="PortAudioSharp2" Version="*" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Common\Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -8,13 +8,8 @@
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<RestoreSources>/tmp/packages;$(RestoreSources);https://api.nuget.org/v3/index.json</RestoreSources>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CommandLineParser" Version="2.9.1" />
|
||||
<PackageReference Include="org.k2fsa.sherpa.onnx" Version="*" />
|
||||
<ProjectReference Include="..\Common\Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -8,14 +8,8 @@
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
<PropertyGroup>
|
||||
<RestoreSources>/tmp/packages;$(RestoreSources);https://api.nuget.org/v3/index.json</RestoreSources>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CommandLineParser" Version="2.9.1" />
|
||||
<PackageReference Include="org.k2fsa.sherpa.onnx" Version="*" />
|
||||
<ProjectReference Include="..\Common\Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -8,12 +8,8 @@
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<RestoreSources>/tmp/packages;$(RestoreSources);https://api.nuget.org/v3/index.json</RestoreSources>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="org.k2fsa.sherpa.onnx" Version="*" />
|
||||
<ProjectReference Include="..\Common\Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -8,14 +8,12 @@
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<RestoreSources>/tmp/packages;$(RestoreSources);https://api.nuget.org/v3/index.json</RestoreSources>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CommandLineParser" Version="2.9.1" />
|
||||
<PackageReference Include="org.k2fsa.sherpa.onnx" Version="*" />
|
||||
<PackageReference Include="PortAudioSharp2" Version="*" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Common\Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -8,12 +8,8 @@
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<RestoreSources>/tmp/packages;$(RestoreSources);https://api.nuget.org/v3/index.json</RestoreSources>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="org.k2fsa.sherpa.onnx" Version="*" />
|
||||
<ProjectReference Include="..\Common\Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -8,12 +8,8 @@
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<RestoreSources>/tmp/packages;$(RestoreSources);https://api.nuget.org/v3/index.json</RestoreSources>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="org.k2fsa.sherpa.onnx" Version="*" />
|
||||
<ProjectReference Include="..\Common\Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -1,19 +1,15 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<RootNamespace>vad_non_streaming_asr_paraformer</RootNamespace>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<RestoreSources>/tmp/packages;$(RestoreSources);https://api.nuget.org/v3/index.json</RestoreSources>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="org.k2fsa.sherpa.onnx" Version="*" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<RootNamespace>vad_non_streaming_asr_paraformer</RootNamespace>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Common\Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user