Refactor .Net example project (#1049)
Co-authored-by: 东风破 <birdfishs@163.com>
This commit is contained in:
1
.github/workflows/test-dot-net.yaml
vendored
1
.github/workflows/test-dot-net.yaml
vendored
@@ -134,6 +134,7 @@ jobs:
|
||||
- name: Copy files
|
||||
shell: bash
|
||||
run: |
|
||||
cp -v scripts/dotnet/examples/Common.csproj dotnet-examples/Common/
|
||||
cp -v scripts/dotnet/examples/offline-tts.csproj dotnet-examples/offline-tts/
|
||||
cp -v scripts/dotnet/examples/offline-decode-files.csproj dotnet-examples/offline-decode-files/
|
||||
cp -v scripts/dotnet/examples/online-decode-files.csproj dotnet-examples/online-decode-files/
|
||||
|
||||
3
dotnet-examples/.gitignore
vendored
3
dotnet-examples/.gitignore
vendored
@@ -1,3 +1,6 @@
|
||||
bin
|
||||
obj
|
||||
v17
|
||||
.vs
|
||||
!*.sh
|
||||
*.vsidx
|
||||
|
||||
13
dotnet-examples/Common/Common.csproj
Normal file
13
dotnet-examples/Common/Common.csproj
Normal file
@@ -0,0 +1,13 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<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="1.10.1" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -1 +0,0 @@
|
||||
../online-decode-files/WaveReader.cs
|
||||
@@ -9,8 +9,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CommandLineParser" Version="2.9.1" />
|
||||
<PackageReference Include="org.k2fsa.sherpa.onnx" Version="*" />
|
||||
<ProjectReference Include="..\Common\Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="org.k2fsa.sherpa.onnx" Version="*" />
|
||||
<ProjectReference Include="..\Common\Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
0
dotnet-examples/offline-punctuation/run.sh
Executable file → Normal file
0
dotnet-examples/offline-punctuation/run.sh
Executable file → Normal file
@@ -9,9 +9,11 @@
|
||||
</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>
|
||||
|
||||
@@ -9,8 +9,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CommandLineParser" Version="2.9.1" />
|
||||
<PackageReference Include="org.k2fsa.sherpa.onnx" Version="*" />
|
||||
<ProjectReference Include="..\Common\Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -9,8 +9,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CommandLineParser" Version="2.9.1" />
|
||||
<PackageReference Include="org.k2fsa.sherpa.onnx" Version="*" />
|
||||
<ProjectReference Include="..\Common\Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -3,34 +3,33 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.0.31903.59
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "online-decode-files", "online-decode-files\online-decode-files.csproj", "{45307474-BECB-4ABE-9388-D01D55A1A9BE}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "online-decode-files", "online-decode-files\online-decode-files.csproj", "{45307474-BECB-4ABE-9388-D01D55A1A9BE}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "offline-decode-files", "offline-decode-files\offline-decode-files.csproj", "{2DAB152C-9E24-47A0-9DB0-781297ECE458}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "offline-decode-files", "offline-decode-files\offline-decode-files.csproj", "{2DAB152C-9E24-47A0-9DB0-781297ECE458}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "speech-recognition-from-microphone", "speech-recognition-from-microphone\speech-recognition-from-microphone.csproj", "{FE4EA1FF-062A-46B3-B78D-C828FED7B82E}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "speech-recognition-from-microphone", "speech-recognition-from-microphone\speech-recognition-from-microphone.csproj", "{FE4EA1FF-062A-46B3-B78D-C828FED7B82E}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "offline-tts", "offline-tts\offline-tts.csproj", "{72196886-7143-4043-96E2-BCACEC6C79EB}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "offline-tts", "offline-tts\offline-tts.csproj", "{72196886-7143-4043-96E2-BCACEC6C79EB}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "offline-tts-play", "offline-tts-play\offline-tts-play.csproj", "{40781464-5948-462B-BA4B-98932711513F}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "offline-tts-play", "offline-tts-play\offline-tts-play.csproj", "{40781464-5948-462B-BA4B-98932711513F}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "spoken-language-identification", "spoken-language-identification\spoken-language-identification.csproj", "{3D7CF3D6-AC45-4D50-9619-5687B1443E94}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "spoken-language-identification", "spoken-language-identification\spoken-language-identification.csproj", "{3D7CF3D6-AC45-4D50-9619-5687B1443E94}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "streaming-hlg-decoding", "streaming-hlg-decoding\streaming-hlg-decoding.csproj", "{C4A368A5-FCA0-419D-97C9-C8CE0B08EB99}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "streaming-hlg-decoding", "streaming-hlg-decoding\streaming-hlg-decoding.csproj", "{C4A368A5-FCA0-419D-97C9-C8CE0B08EB99}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "speaker-identification", "speaker-identification\speaker-identification.csproj", "{2B1B140E-A92F-426B-B0DF-5D916B67304F}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "speaker-identification", "speaker-identification\speaker-identification.csproj", "{2B1B140E-A92F-426B-B0DF-5D916B67304F}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "offline-punctuation", "offline-punctuation\offline-punctuation.csproj", "{42D85582-BB63-4259-A4EA-837D66AC078B}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "offline-punctuation", "offline-punctuation\offline-punctuation.csproj", "{42D85582-BB63-4259-A4EA-837D66AC078B}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "vad-non-streaming-asr-paraformer", "vad-non-streaming-asr-paraformer\vad-non-streaming-asr-paraformer.csproj", "{8CD6B7E5-F59F-47B3-BB87-2B2E3678924D}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "vad-non-streaming-asr-paraformer", "vad-non-streaming-asr-paraformer\vad-non-streaming-asr-paraformer.csproj", "{8CD6B7E5-F59F-47B3-BB87-2B2E3678924D}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common", "Common\Common.csproj", "{401E963F-E25A-43CE-987D-8DB2D4715756}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{45307474-BECB-4ABE-9388-D01D55A1A9BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{45307474-BECB-4ABE-9388-D01D55A1A9BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
@@ -72,5 +71,15 @@ Global
|
||||
{8CD6B7E5-F59F-47B3-BB87-2B2E3678924D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{8CD6B7E5-F59F-47B3-BB87-2B2E3678924D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{8CD6B7E5-F59F-47B3-BB87-2B2E3678924D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{401E963F-E25A-43CE-987D-8DB2D4715756}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{401E963F-E25A-43CE-987D-8DB2D4715756}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{401E963F-E25A-43CE-987D-8DB2D4715756}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{401E963F-E25A-43CE-987D-8DB2D4715756}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {07A6023C-0A37-4F82-A29F-896A3A338EAC}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../offline-decode-files/WaveReader.cs
|
||||
@@ -9,7 +9,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="org.k2fsa.sherpa.onnx" Version="*" />
|
||||
<ProjectReference Include="..\Common\Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -9,9 +9,11 @@
|
||||
</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>
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../offline-decode-files/WaveReader.cs
|
||||
@@ -9,7 +9,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="org.k2fsa.sherpa.onnx" Version="*" />
|
||||
<ProjectReference Include="..\Common\Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../online-decode-files/WaveReader.cs
|
||||
@@ -9,7 +9,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="org.k2fsa.sherpa.onnx" Version="*" />
|
||||
<ProjectReference Include="..\Common\Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../online-decode-files/WaveReader.cs
|
||||
0
dotnet-examples/vad-non-streaming-asr-paraformer/run.sh
Executable file → Normal file
0
dotnet-examples/vad-non-streaming-asr-paraformer/run.sh
Executable file → Normal file
@@ -9,7 +9,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="org.k2fsa.sherpa.onnx" Version="*" />
|
||||
<ProjectReference Include="..\Common\Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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,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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user