BROHEIM_CYBRP-BroheimSileroTTS icon

BroheimSileroTTS

Self-contained in-game TTS for Valheim - speaks chat, runes, raven/intro, center-screen messages, dreams and NPC dialogue. Bundled pure-C# Silero neural voices (RU/EN/DE) via TorchSharp. No Python, no extra downloads, no Piper.

Last updated 2 days ago
Total downloads 2
Total rating 1 
Categories Mods Audio Client-side Utility Mistlands Update Hildir's Request Update Ashlands Update Bog Witch Update AI Generated
Dependency string BROHEIM_CYBRP-BroheimSileroTTS-1.3.0
Dependants 0 other packages depend on this package

This mod requires the following mods to function

denikson-BepInExPack_Valheim-5.4.2202 icon
denikson-BepInExPack_Valheim

BepInEx pack for Valheim. Preconfigured and includes unstripped Unity DLLs.

Preferred version: 5.4.2202

README

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 v5_4_ru 4 Automatic stress marking + Ρ‘, digits β†’ words, Latin β†’ Cyrillic transliteration. n-gram accentor (the v5 BERT homograph disambiguation is not bundled β€” homographs use n-gram-predicted stress).
πŸ‡¬πŸ‡§ 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.
  • ~475 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 / aidar, chat + center narration on).


Configuration β€” BepInEx/config/Broheim.SileroTTS.cfg

Section [Voice]

Setting Default Description
Language Russian Bundled Silero model: Russian (v5_4_ru, n-gram auto-stress + Ρ‘, 4 voices), English (v3_en, 119 voices) or German (v3_de, 5 voices, umlaut handling).
Speaker aidar Speaker name for the chosen language (see list below).
Pitch 1.0 Pitch multiplier. < 1.0 = lower / rougher / deeper (e.g. 0.85), > 1.0 = higher / brighter. Range 0.5 – 2.0. Shifts the model's pitch contour without retraining.
Speed 1.0 Speech speed multiplier. < 1.0 = slower (e.g. 0.85), > 1.0 = faster. Range 0.5 – 2.0. Controls token-duration scaling.
Volume 1.0 Output volume multiplier. > 1.0 amplifies (e.g. 1.5 louder, 2.0 very loud; hard-clipped). < 1.0 = quieter. Range 0.0 – 3.0. Independent of the game's master volume.
OverlapMode Queue How overlapping lines are handled: Queue (wait for current to finish, then play next β€” no overlap), Interrupt (cut off current, play new), Overlap (mix).
PreRollMs 120 Leading silence (ms) before each utterance. Fixes "first letters swallowed" β€” the audio source drops the first buffer on start, so a lead-in lets the first phoneme land clean. 0 = off. Range 0 – 500.
TrimTrailingSilence true Cut the model's trailing quiet tail so narration feels snappy.

Section [Channel Volume]

Per-channel volume multipliers (applied on top of [Voice] Volume). Range 0.0 – 3.0.

Setting Default Description
ChatVolume 1.0 Chat narration.
CenterVolume 1.0 Center-screen messages (Huginn tips, events).
RunesVolume 1.0 Rune / raven / intro text.
NpcVolume 1.0 NPC dialogue.
DreamsVolume 1.0 Dream / portal text.

Valid Speaker per language

  • Russian: aidar (male), baya, kseniya, xenia (v5_4_ru has 4 voices; eugene falls back to xenia). Use Pitch < 1.0 (e.g. 0.85) to make aidar rougher/deeper.
  • English: en_0 … en_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            v5_4_ru neural model
  ru/silero_accentor_v5.dat   RU n-gram accentor: embedding, MLP, symbols, exceptions (16969)
  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. To make a voice rougher/deeper without changing the speaker, lower Pitch (e.g. 0.85); to speed up/slow down, adjust Speed.

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.