Valheim
You are viewing a potentially older version of this package. View Latest Version
Install

Details

Date Uploaded
2 weeks ago
Downloads
41
Size
225MB
Dependency string
BROHEIM_CYBRP-BroheimSileroTTS-1.0.0
ADDatHost Valheim hosting
30% off!

Broheim Silero TTS

Self-contained in-game text-to-speech for Valheim. The mod speaks aloud the text you normally only read: chat messages, rune/raven and intro text, center-screen messages, dreams and NPC dialogue — powered entirely by bundled Silero neural voices running in pure C# through TorchSharp (libtorch).

No Python, no extra client-side install, no runtime downloads. Voices work out of the box on the first launch.

Inspired by Azumatt's TextToSpeech

This mod was inspired by Azumatt's TextToSpeech — the idea of speaking Valheim's chat, runes, raven and NPC text aloud. All code in this package is written from scratch; a big thank-you to Azumatt for the original concept and for his work in the Valheim modding community.

Language Model Speakers Notes
🇷🇺 Russian v4_ru 5 Automatic stress marking + ё, digits → words, Latin → Cyrillic transliteration.
🇬🇧 English v3_en 119 (12 curated) 12 hand-picked male/female voices grouped by pitch.
🇩🇪 German v3_de 5 Umlaut handling (ß/ä/ö/ü).

This is a client-side mod — it does not need to be installed on, and is not synced to, the dedicated server.


Requirements

  • BepInExPack Valheim — Thunderstore package denikson-BepInExPack_Valheim (declared as a dependency).
  • Windows x64 client. The bundled libtorch native runtime (torch_cpu.dll, c10.dll, LibTorchSharp.dll, …) is Windows-only.
  • ~430 MB of disk space for the bundled Silero models + libtorch runtime (shipped inside the package, so the download is one-time).

Install

Install via Thunderstore / r2modman / Gale, or manually unzip the package and copy BepInEx/plugins/Broheim-SileroTTS/ into your Valheim BepInEx/plugins/ directory.

On first launch the mod generates BepInEx/config/Broheim.SileroTTS.cfg with sensible defaults (Russian / xenia, chat + center narration on).


Configuration — BepInEx/config/Broheim.SileroTTS.cfg

Section [Voice]

Setting Default Description
Language Russian Bundled Silero model: Russian (v4_ru, auto-stress + ё, 5 voices), English (v3_en, 119 voices) or German (v3_de, 5 voices, umlaut handling).
Speaker xenia Speaker name for the chosen language (see list below).

Valid Speaker per language

  • Russian: xenia, aidar, baya, kseniya, eugene
  • English: en_0en_117 — curated subset: en_0, en_20, en_27, en_42, en_46, en_70, en_80, en_91, en_48, en_116, en_82, en_67, en_95 (any en_N index is accepted).
  • German: bernd_ungerer, eva_k, friedrich, hokuspokus, karlsson

Section [Triggers]

Setting Default Description
NarrateChat true Speak incoming chat messages.
SkipOwnChat true Do not speak your own outgoing chat messages. Turn off to hear yourself (useful when testing a voice).
AnnounceSpeaker false Prepend the speaker name and verb to chat narration (e.g. "Haldor said in chat: ..."). Off = voice only the message body.
NarrateCenter true Speak center-screen messages (Huginn tips, boss defeats, event starts).
NarrateRunes false Speak rune, raven and intro/tutorial text.
NarrateNpc false Speak NPC dialogue, positioned near the speaker.
NarrateDreams false Speak the dream/portal text shown between sessions.

How it works

Silero runs entirely inside the mod via TorchSharp — the same libtorch runtime that Python uses, but loaded directly from .NET. The Silero TorchScript .pt models are loaded directly by libtorch, which bypasses the well-known ONNX exporter failures on Silero's dynamic prim::If runtime checks. No ONNX, no Python, no sidecar process.

Text preprocessing is a hand-ported C# implementation, verified bit-identical against the original Python apply_tts pipeline:

  • Russian: automatic stress assignment, ё insertion, n-gram stress embedding, MLP stress model, digits → Russian words (e.g. 3.14«три запятая один четыре») and Latin → Cyrillic transliteration so English words/names are attempted instead of silently skipped.
  • English / German: lowercasing, symbol filtering, ASCII/umlaut mapping, per-language speaker/symbol maps.

The neural tts_model (duration and pitch predictors, encoder, decoder and vocoder) runs natively in libtorch from silero_assets/<lang>/tts_runner.pt.

silero_assets/ layout (shipped with the mod):

silero_assets/
  ru/tts_runner.pt        v4_ru neural model
  ru/silero_accentor.dat  RU accentor: n-gram, MLP, symbols, exceptions
  en/tts_runner.pt        v3_en
  en/preprocess.dat       EN symbol/speaker map
  de/tts_runner.pt        v3_de
  de/preprocess.dat       DE symbol/speaker/umlaut map
  TorchSharp.dll + libtorch-cpu-win native DLLs (shared, ~256 MB)

Bundled .NET Standard 2.0 facades resolve TorchSharp's managed dependency closure under Valheim's Mono runtime — that is what makes "no client install" possible.

Troubleshooting

  • No sound. Confirm Language and Speaker match (e.g. don't set a German speaker with Language = Russian). Relaunch after changing the voice.
  • Numbers or English words skipped (RU). The RU accentor expands digits to words and transliterates Latin before synthesis; if something specific is still skipped it is usually an unsupported symbol in the accentor's table.
  • Slow first utterance. The first synthesis warms up libtorch (JIT + native library init). Subsequent utterances are fast.
  • Want a different voice. Pick another Speaker for the current language, or switch Language.

Credits & acknowledgements

  • Silero TTS models by the Silero team.
  • TorchSharp — Microsoft's .NET bindings for libtorch / PyTorch.
  • Valheim chat/rune/NPC/center/dream narration via Harmony patches on the game's public API.

This mod was inspired by Azumatt's TextToSpeech (https://thunderstore.io/c/valheim/p/Azumatt/TextToSpeech/) — the idea of speaking Valheim's chat, runes, raven and NPC text aloud. All code in this package is written from scratch; big thanks to Azumatt for the original concept and for his work on the Valheim modding community.

Source code and releases: https://github.com/alexkuryshko/Broheim-SileroTTS

See CHANGELOG.md for the version history.

Thunderstore development is made possible with ads. Please consider making an exception to your adblock.