love.js icon indicating copy to clipboard operation
love.js copied to clipboard

.xm files don't play through libmodplug

Open kraxarn opened this issue 9 years ago • 6 comments

Tried loading an .xm file and it fails to load and doesn't play with no error in the console

kraxarn avatar Jul 11 '16 01:07 kraxarn

Very possible since I don't think I've tried anything that would rely on libmodplug yet. Can you upload a test case for me?

On Sunday, 10 July 2016, Emily [email protected] wrote:

Tried loading an .xm file and it fails to load and doesn't play with no error in the console

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/TannerRogalsky/love.js/issues/37, or mute the thread https://github.com/notifications/unsubscribe/AAn-U4SgTqSc-FpGT_iIX2Q0tcwMw_rVks5qUZ7_gaJpZM4JI-A0 .

TannerRogalsky avatar Jul 11 '16 01:07 TannerRogalsky

A preview: http://web.kraxarn.com/beta/lovejs/html/ Or the code: http://web.kraxarn.com/beta/lovejs/game.love But it's basically just

function love.load()
    music = love.audio.newSource("music.xm")
    music:play()
end

Or did you mean something else?

kraxarn avatar Jul 11 '16 01:07 kraxarn

@KraXarN Nope, that's perfect. I'll look into this, thanks!

TannerRogalsky avatar Jul 11 '16 11:07 TannerRogalsky

Perfect! Don't know if this helps, but here's libmodplug ported to the web using Emscripten.

kraxarn avatar Jul 11 '16 13:07 kraxarn

I've tested a number of other formats and they all seem to work well. It's just the .xm files that fail to play. Even on this standalone port of libmodplug, the readme mentions "For some reason songs abruptly end, or start in the middle, or don't play at all (.xm)." So something's up with that format's decoding that is particular to it.

Our version of libmodplug is slightly out of date for stable releases but (despite years) it seems to have only been security patches. The source code seems to have had it's version bumped by a minor version very recently, though. Might try incorporating those changes. https://github.com/Konstanty/libmodplug/commits/master

If that doesn't help it's probably worth bringing in someone more familiar with libmodplug. Debugging a single format breaking on a single platform is pretty specialized.

TannerRogalsky avatar May 31 '17 12:05 TannerRogalsky

An alternative option could be libopenmpt, which is actually maintained and updated, and has nearly the same feature set (to my knowledge, except some functions that löve didn't make use of anyway.)

zorggn avatar Feb 12 '19 17:02 zorggn