libsdl-org / SDL_mixer

An audio mixer that supports various file formats for Simple Directmedia Layer.
zlib License
434 stars 146 forks source link

XMP : sound on bigendian platform #306

Closed BeWorld2018 closed 3 years ago

BeWorld2018 commented 3 years ago

Hi, When i use XMP on SDL2_mixer, sound is crappy/corrumpt.. the bug is present here : https://github.com/libsdl-org/SDL_mixer/blob/master/src/codecs/music_xmp.c#L216

When i put AUDIO_S16SYS, all working.

Thanks

sezero commented 3 years ago

Thanks! Will fix shortly.

Opus needs the same change, does it not? https://github.com/libsdl-org/SDL_mixer/blob/master/src/codecs/music_opus.c#L198

sezero commented 3 years ago

Pushed https://github.com/libsdl-org/SDL_mixer/commit/02c94d7644faff05936f6bd51e1cef2f67dd863c as the fix. Also pushed https://github.com/libsdl-org/SDL_mixer/commit/cbb79ee4f42be4060c7bfe8e8f11b6bba61d9084 for opus.

sezero commented 3 years ago

music_mad.c possibly needs the same change: https://github.com/libsdl-org/SDL_mixer/blob/master/src/codecs/music_mad.c#L486

Can you confirm?

BeWorld2018 commented 3 years ago

ok i test with Mad, i use actualy MPG123.. For Opus, I have not yet managed to compile it on MorphOS .... I need to work on it.

sezero commented 3 years ago

ok i test with Mad,

Thanks, waiting your results

For Opus, I have not yet managed to compile it on MorphOS .... I need to work on it.

If it helps, I have opus decoder-only binaries for morphos here: https://github.com/sezero/uhexen2/blob/master/oslibs/morphos/codecs/lib/libopus.a https://github.com/sezero/uhexen2/blob/master/oslibs/morphos/codecs/lib/libopusfile.a

BeWorld2018 commented 3 years ago

thanks !! I compiled Opus :-) and working fine now, just need some motivation

so MAD = same problem, you can fix, i test it with AUDIO_S16SYS and it's ok for me

Thanks again

sezero commented 3 years ago

thanks !! I compiled Opus :-) and working fine now, just need some motivation

You're welcome,

so MAD = same problem, you can fix, i test it with AUDIO_S16SYS and it's ok for me

Applied https://github.com/libsdl-org/SDL_mixer/commit/b7aa31c1daeb048fde27970a1e9190340948f222, thanks!

sezero commented 3 years ago

@icculus: Is load_voc.c affected? See: https://github.com/libsdl-org/SDL_mixer/blob/master/src/codecs/load_voc.c#L402

BeWorld2018 commented 3 years ago

My tests with VOC ( sample3.voc here : https://filesamples.com/formats/voc)

i test with "playmus", file not loading , filetype seem not detected

I test with "playwave", working but not need to change format (AUDIO_S16 is ok here)

sezero commented 3 years ago

My tests with VOC ( sample3.voc here : https://filesamples.com/formats/voc)

i test with "playmus", file not loading , filetype seem not detected

I test with "playwave", working but not need to change format (AUDIO_S16 is ok here)

Thanks!