TannerRogalsky / love.js

LÖVE ported to the web using Emscripten
MIT License
493 stars 53 forks source link

.xm files don't play through libmodplug #37

Open kraxarn opened 8 years ago

kraxarn commented 8 years ago

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

TannerRogalsky commented 8 years ago

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 notifications@github.com 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 .

kraxarn commented 8 years ago

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?

TannerRogalsky commented 8 years ago

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

kraxarn commented 8 years ago

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

TannerRogalsky commented 7 years ago

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.

zorggn commented 5 years ago

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.)