arescentral / antares

A tactical space combat game
http://arescentral.org/antares/
GNU Lesser General Public License v3.0
100 stars 18 forks source link

Music omits last pattern of song #457

Closed sfiera closed 11 months ago

sfiera commented 11 months ago

Apparently sections of the music are dropped, particularly at the beginning/end of the loop. Not clear if the problem is in the libmodplug renderer or in the XAudio2 driver.

sfiera commented 11 months ago

As a quick check I printed out the length of the converted audio but it seems to match between platforms:

music: doomtroopers-unite 26744832 2 44100
music: autoregret 14920704 2 44100
music: freds-theme 20281344 2 44100
music: eyes-of-fire 18984960 2 44100
music: doomtroopers-unite 26744832 2 44100
music: freds-theme 20281344 2 44100
music: yesterday 14405632 2 44100
music: doomtroopers-unite 26744832 2 44100

e.g. Yesterday should be (14405632 ÷ (44100 × 2 × 2)) = 81.66 seconds long on both platforms.

sfiera commented 11 months ago

I don’t think this is Windows-specific. I hear a pause at the end of tracks on Mac too.

sfiera commented 11 months ago

There seems to be a problem with libmodplug where 6 bytes are required after the last pattern or else it will be dropped. Reported as Konstanty/libmodplug#95, but I for now I’ll just add padding to the Antares data.

sfiera commented 11 months ago

With these changes the lengths I see are:

music: doomtroopers-unite 26744832 2 44100
music: autoregret 16275456 2 44100
music: freds-theme 21473280 2 44100
music: eyes-of-fire 21694464 2 44100
music: doomtroopers-unite 26744832 2 44100
music: freds-theme 21473280 2 44100
music: yesterday 15252480 2 44100
music: doomtroopers-unite 26744832 2 44100