HarbourMasters / HarbourMasters/Shipwright
Japanese dialogue is decoded incorrectly by Accessibility Text-to-Speech
- Dominant language
- C
- Stars
- 5.4k
- Forks
- 837
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 72
Description
## Description
When playing the Japanese version of Ocarina of Time in Ship of Harkinian, the built-in Accessibility Text-to-Speech feature does not correctly read in-game dialogue.
Instead of reading the Japanese text shown in the textbox, it produces unintelligible speech resembling incorrectly decoded characters.
English UI elements and menus are spoken normally.
## Steps to reproduce
1. Launch Ship of Harkinian using Japanese Ocarina of Time assets.
2. Enable Text-to-Speech with F9.
3. Open any Japanese NPC dialogue or sign.
4. Listen to the spoken output.
## Expected behavior
The displayed Japanese text should be passed correctly to a Japanese-capable TTS voice.
## Actual behavior
UI labels may be spoken correctly or through English accessibility strings. For example, `しゃべる` is spoken as “Speak.”
Japanese textbox dialogue is not read correctly. It produces unintelligible speech and may pronounce unrelated symbols such as “dollar” and “underscore,” although those symbols are not present in the displayed text.
## Voice test
I installed a Japanese Windows TTS voice and verified outside the game that it correctly reads normal Japanese text.
For example, the Windows voice correctly reads:
`この先デクの樹サマの広場`
However, Ship of Harkinian still produces unintelligible speech for the same Japanese dialogue.
The voice used by Ship of Harkinian also sounds different from the Japanese voice selected in Windows, so SoH may be selecting a different voice or speech backend. Regardless, the output does not resemble ordinary Japanese read with a foreign accent; it sounds like incorrectly decoded input.
## Technical observation
While investigating this for an external text hook, I found that Japanese dialogue is decoded through `Message_DecodeJPN` and stored in `MessageContext::msgBufDecodedWide`.
Reading that buffer and converting its 16-bit CP932-style values produces the correct Japanese textbox text.
This suggests that the TTS path may be reading the 8-bit decoded buffer or otherwise converting the Japanese wide message buffer incorrectly.
## Additional observations
Some interface text is handled differently from dialogue.
For example, the Japanese button label `しゃべる` is spoken as the English word “Speak.” This suggests that some UI accessibility labels use translated or separately defined strings.
Japanese dialogue still produces unintelligible output. The TTS sometimes reads words such as “dollar” and “underscore,” even though `$` and `_` do not appear anywhere in the visible dialogue.
This makes the issue appear specific to the dialogue-message decoding path rather than Japanese TTS support in general. It may indicate that message control bytes or incorrectly decoded character data are being passed to the speech system.
## Environment
- Ship of Harkinian 9.2.3
- Windows x64
- Japanese Ocarina of Time assets
- Japanese Windows TTS voice installed and tested successfully outside the game
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing the accessibility TTS path that consumes MessageContext::msgBufDecodedWide after Message_DecodeJPN. Compare the text passed to speech with the displayed Japanese dialogue and verify that Japanese NPC and sign text is spoken correctly without unrelated symbols, while English UI speech remains working.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- accessibility, game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100