Skip to content

Fix #5742 - Add voice language separation option - #8659

Open
mmustafasenoglu wants to merge 1 commit into
diasurgical:masterfrom
mmustafasenoglu:feat/voice-language-option
Open

Fix #5742 - Add voice language separation option#8659
mmustafasenoglu wants to merge 1 commit into
diasurgical:masterfrom
mmustafasenoglu:feat/voice-language-option

Conversation

@mmustafasenoglu

Copy link
Copy Markdown

Fixes #5742

Adds a separate voice language setting that allows users to use a different voice acting language from the text translation language. This is especially useful for Android users who want English voices with their native text (e.g. Russian text + English voices).

Approach

The existing language MPQ system bundles both text translations and voice clips in a single MPQ file per language. This PR adds path-aware MPQ routing to separate them:

  1. New option: Added "Voice Language" setting under Language Settings (INI key: VoiceCode)
  2. Voice MPQ loading: When voice language differs from text language, a second language MPQ is loaded at priority 9150 (VoiceLangMpqPriority)
  3. Path-aware routing in FindMpqFile: Files under sfx\ route to the voice MPQ, all other files route to the text MPQ
  4. Live switching: Voice language changes reload the voice archive and reinitialize sound without requiring a restart

Changes

  • Source/engine/assets.hpp: Add VoiceLangMpqPriority constant, LoadVoiceLanguageArchive() and VoiceMpqSeparationActive() declarations
  • Source/engine/assets.cpp: Implement path-aware routing in FindMpqFile(), add LoadVoiceLanguageArchive() and VoiceMpqSeparationActive()
  • Source/utils/language.h/.cpp: Add GetVoiceLanguageCode()
  • Source/options.h/.cpp: Add OptionEntryLanguageCode constructor overload, voiceCode to LanguageOptions
  • Source/diablo.cpp: Load voice archive on startup, add voice language change callback

Adds a separate voice language setting that allows using different
voice acting language from the text translation language.

When voice and text languages differ, a second language MPQ is loaded
at VoiceLangMpqPriority (9150). FindMpqFile routes sfx/* requests
to the voice MPQ and other files to the text MPQ, so voice clips
and text strings come from independent language packs.
Copilot AI lite review requested due to automatic review settings August 5, 2026 07:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@mmustafasenoglu

Copy link
Copy Markdown
Author

Hi! Just checking in on this PR. Happy to address any feedback or make changes if needed. Thanks for reviewing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add option for voice over language

2 participants