
Sherpa ONNX for Vintage Story
Adds Sherpa ONNX support to Vintage Story. Easy to use, supporting most common operating systems.
Description
Sherpa ONNX for Vintage Story
That's right, <span style="color: #2880b9;">Sherpa ONNX</span> is now in Vintage Story for use by any modders with crazy schemes involving text-to-voice models!
This library includes all compiled natives across all relevant operating systems, ensuring that your mod is cross-platform and ready for large servers.
<span style="background-color: #e74c3c;">WARNING: THIS IS A MOD LIBRARY | FOR USE AS A DEPENDENCY.
<span style="background-color: #f1c40f;">IF YOU'RE A NORMAL USER, DON'T DOWNLOAD THIS UNLESS ANOTHER MOD TOLD YOU TO.
THIS IS NOT A MOD, JUST SOMETHING THAT MAKES MODS WORK.</span></span>
Supported Architectures:
- Windows x86
- Linux x86 (Linux ARM not supported by the game, and won't be supported by this mod at the moment)
- MacOS (x86 + Apple Silicon/ARM)
How to use:
First, add this mod as a dependency to your mod.
<pre class="language-javascript">"dependencies": { "game": "", "vssherpaonnx": "" }</pre>
Then, directly download the mod and extract VintagestoryAPI.dll onto the root (or src, or whatever you use) folder of your mod.
Once that's done, edit your CSProj to include the following:
<ItemGroup> <Reference Include="vssherpaonnx"> <HintPath>$(MSBuildProjectDirectory)\vssherpaonnx.dll</HintPath> <Private>false</Private> </Reference> </ItemGroup></pre>
Then, include the API in any files that need it.
<pre class="language-csharp">using VSSherpaOnnx;</pre>
You can now save a reference (store a variable) to the resolved Sherpa assemblies via:
<pre class="language-cpp">var sherpaAsm = VSSherpaOnnxSystem.EnsureSherpaReady(api);</pre>
That's all there is. You can now use Sherpa ONNX as you wish. You can use the code for RPTTS as an example, or look at the example below:
<pre class="language-csharp">var offlineTtsType = sherpaAsm.GetType("SherpaOnnx.OfflineTts", throwOnError: true);</pre>
Finally, here are some helper/debug print functions:
<pre class="language-csharp">static string VSSherpaOnnxSystem.GetResolvedRid() static string VSSherpaOnnxSystem.GetResolvedNativeDirectory() static string VSSherpaOnnxSystem.GetManagedWrapperPath()</pre>
Do not attempt to call the following manually:
<pre class="language-csharp">LoadFromAssemblyPath NativeLibrary.Load</pre>
Have fun!
This mod is brought to you by...

The Unofficial Vintage Story Modding Co-op, click here to join.
As modders, we can help each other make even better stuff. Plus, we have dedicated channels for better organization.
Ratings & reviews
Sign in to leave a rating or comment.
