Mods / Sherpa ONNX for Vintage Story

Tags: #Library
Author: YangWenLi
Side: Both
Created: Sep 23rd at 12:47 AM
Last modified: Sep 23rd at 8:04 PM
Downloads: 2009
Follow Unfollow 12

Latest release (for Vintage Story 1.21.0 and 1.21.1, potentially outdated):
vssherpaonnx.zip  1-click install


Sherpa ONNX for Vintage Story

That's right, Sherpa ONNX 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.

 

WARNING: THIS IS A MOD LIBRARY | FOR USE AS A DEPENDENCY.
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.

Supported Architectures:

  • Windows x86
  • Linux x86
  • (OSX support currently awaiting on finding the one user in our entire modding community that uses a Mac)
  • (Linux ARM not supported yet for a similar reason, and also the game dropped support for it back in 1.8.0)

How to use:

First, add this mod as a dependency to your mod.

"dependencies": {
  "game": "*",
  "vssherpaonnx": "*"
}

 

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>

 

Then, include the API in any files that need it.

using VSSherpaOnnx;

 

 

You can now save a reference (store a variable) to the resolved Sherpa assemblies via:

var sherpaAsm = VSSherpaOnnxSystem.EnsureSherpaReady(api);

 

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:

var offlineTtsType = sherpaAsm.GetType("SherpaOnnx.OfflineTts", throwOnError: true);

 

Finally, here are some helper/debug print functions:

static string VSSherpaOnnxSystem.GetResolvedRid()
static string VSSherpaOnnxSystem.GetResolvedNativeDirectory()
static string VSSherpaOnnxSystem.GetManagedWrapperPath()

 

Do not attempt to call the following manually:

LoadFromAssemblyPath
NativeLibrary.Load

 

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.

Mod Version Mod IdentifierFor Game version Downloads Released Changelog Download 1-click mod install*
1.0.0 vssherpaonnx 1958 Sep 23rd at 12:48 AM vssherpaonnx.zip 1-click install

Initial Release

0.0.120 vssherpaonnx
1.20.11 - 1.20.12
51 Sep 23rd at 8:04 PM vssherpaonnx.zip 1-click install

Net 7 release for older versions of the game


6 Comments (oldest first | newest first)

💬 YangWenLi , 6 days ago

Hey Michael97 and neobit, someone reached out to me with the same errors as you had. They sent me the full crash logs and I was able to determine that the reason was because they were using an older build of the mod meant for net7 instead of the new build for net8. They also then had some crashes due to not shutting down the server before swapping the builds, make sure to do that too.

I'm not sure if this helps, but I hope it does.

💬 YangWenLi , Oct 7th at 10:52 PM

Hello Michael97, apologies for not making it clearer. 

You can find me under my username in the discord linked at the end of each of my mods (the co-op), I am also in the official VS discord under my actual name.

If you want to add me directly, it's cortellhugo.

💬 Michael97, Oct 7th at 6:19 PM

I didn't find you or your mods on the VS discord.

I added someone by your VS name in discord in the hope they may match.

Provide additional contact information if it isn't.

💬 YangWenLi , Oct 3rd at 4:10 PM

Hello Michael97 and neobit, could you message me on discord your complete crash logs? Server/client logs would be useful too.

As for the note of the mod running after download neobit, could you check if the mod is still enabled in your mod list? If it is, then that's expected, the mod can run client-side even if the server does not have it, though I'll probably disable this in future builds to avoid confusion. If the mod is running but does not show up on your mod list, let me know, as I'd need to investigate further such a thing.

💬 Michael97, Oct 3rd at 10:33 AM (modified Oct 3rd at 10:38 AM)

I am another case of "anyone who joins crashes".

 

Got no OS level acces to the server but I know clients with any OS crash.

 

The crash I get on a Ubuntu fork client states "System.MissingMethodException: Method not found: 'Vintagestory.API.Client.GuiComposer"

Might there be any missing dependencies?

 

On another note: after having unsuccessfully joined the Server with this and the 'rptts' mod depending on it installed the game WILL read me text I type, but none other's.

💬 neobit, Oct 2nd at 7:59 PM (modified Oct 2nd at 8:00 PM)

I have it on Ubuntu server.
Most clients use windows but I have Garuda (arch based).

When we just created the server we were not able to connect with this mod, game was crashing - my bet is that was something with timing (a lot of mods) and both character creation and tts trying to show. When we re-added it after the server was launched and all people joined, it started to work.
I have around 175 mods so Im not entirely sure it was your mod, but who knows?

If you need to test something specific around ARCH (garuda), let me know.

 (edit comment delete)
Основной веб-сайт | Почтовый сервер | FTP сервер | Административная панель | API интерфейс | Content Delivery Network | Статические файлы | Ресурсы сайта | Изображения | Файловое хранилище | Блог | Интернет-магазин | Техническая поддержка | Справочная система | Документация | Форум | Новости | Загрузки | Демонстрация | Тестовая среда | Приложение | Медиа контент | Разработка | Промежуточная среда | Бета версия | Безопасная зона | Вход в систему | Панель управления | Портал | Система управления контентом