vivaria / tja2fumen

Mod tool to convert TJA chart files (.tja) into .bin files compatible with official games
https://pypi.org/project/tja2fumen/
MIT License
12 stars 1 forks source link

TakoTako's audio converter introduces an offset for some songs (Doppelgangers, Rokuchounen, etc.) #29

Closed vivaria closed 1 year ago

vivaria commented 1 year ago

The Doppelgangers chart plays fine in a TJAPlayer, yet the converted fumen feels like it's maybe half a second off for the entirety of the song.

vivaria commented 1 year ago

Some updates:

vivaria commented 1 year ago

Testing the very first release of tja2fumen (v0.0.1), it looks like the converted Rokuchounen is out of sync even then.

This is somewhat good news, because we can rule out any of the changes that I made between v0.0.1 and v0.5.1. However, it also means I must have gotten the song working in my manual playtests, even before I created my first release?

vivaria commented 1 year ago

I tried completely wiping out all of the hardcoded header byte values that I copied over from tja2bin:

https://github.com/vivaria/tja2fumen/blob/ee265327deed3ceb3e9623fdbbf18d0d03f6d7d0/src/tja2fumen/constants.py#L70-L92

However, doing so had no effect on the desync.

vivaria commented 1 year ago

It looks like my early manual tests for Rokuchounen occurred somewhere around https://github.com/vivaria/tja2fumen/commit/c2739b322c215ac0c725029aa8b8d8e649786c72, since it contains the following hardcoded values:

https://github.com/vivaria/tja2fumen/blob/c2739b322c215ac0c725029aa8b8d8e649786c72/tja2fumen/tja2fumen.py#L41-L43

If I checkout this commit then perform the conversion (by populating the test-data/ folder), it is still out of sync.

vivaria commented 1 year ago

Aha!!! I think I've figured it out.

This presents quite the dilemma, since there's not really much I can do in the scope of the tja2fumen repo to fix this problem.

vivaria commented 1 year ago

The audio files in this case are .ogg files:

But, plenty of other .ogg fumens I've tested have had their audio converted by TakoTako without any desync issues. So, I don't think it's due to the file format specifically.

Still, looking at TakoTako's OggToACB function might give us some clues.

vivaria commented 1 year ago

Closing this issue because the cause was identified: https://github.com/Fluto/TakoTako/issues/16#issuecomment-1636960820