Link subtitles to their speaker and audio stream #493
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/holdmysocks--SixNG!493
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-493"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@holdmysocks on GitHub · 2026-11-27 19:02 UTC · original
holdmysocks:claude/dialogue-speaker-audio→master· +1276 −25 · 8 files · 8 commits · merged 2026-11-28 01:57 UTCSummary
Fixes the v0.12.0 known issue "Dialogue: subtitles aren't linked to their speaker or audio stream yet".
sixng dialogue-linkswrites<work>/dialogue_links.jsonfrom two sources:--conversations <archive>reads links from the game's own conversation files. A conversation lists its characters and its lines in spoken order. Each line stores its subtitle label in plain text, its audio cue and its take. The subtitle key isjoaat(label)and the wave is<cue>_<take>. The stream is the one stream with that wave's ID in the archive's SixNG audio index or, when that has none, in the first other archive with an audio index (story lines also play fromaudio.rpf). Generic speech sits in several banks, one per character voice; such a line plays from its speaker's voice bank: the candidate whose container (fromaudio-meta) holds at least two of the speaker's single-bank lines while no other candidate holds any. The speaker is the conversation's character. When several characters talk, each character has a slot number and each line names the slot of its speaker; a line without one falls back to the character whose single-speaker conversations use the line's voice. Lines are matched by their shape rather than by unnamed struct IDs, and field names fall back to their case-sensitive hashes.--addresses <tsv>(optional) reads a local address table that only names the stream. Each address is rebuilt from the audio index: the stream at the bank offset and position must have the given ID, and the encoded range comes from the index. A row for a subtitle that the conversation files already link is not added; it is compared with the derived link (table_check) and only gives it a stream when the files have none. A table speaker ID that no conversation file uses for a character is counted apart (speaker_id_not_in_files). Other rows fill the gaps.text --labelandtext --findadd adialoguelist (speaker, speaker hash, archive, bank, stream position, stream ID, wave name, stem window) to each label that has links.Validation
cargo testpassed locally on Windows for sixng-core, sixng-cli and sixng-gui; after the story-pack change, the sixng-core and sixng-cli dialogue tests again (the viewer code is unchanged).audio.rpfor the main story pack, and 242 generic speech lines from the speaker's voice bank). 20,183 lines name a wave that no indexed archive holds (no other archive has audio banks), and 393 generic speech lines stay unlinked: their speaker has too few single-bank lines to pick a voice bank. The picks are consistent: each speaker's picks fall in one voice bank (one stray line), and no voice bank is picked for two speakers.