Killboy Posted May 25, 2011 Posted May 25, 2011 I'm looking for a C/C++ library for xm module playback that works in 64bit mode. ufmod is x86 only, fmod is too bloated, minifmod has tons of inline asm, bass doesnt seem to have an x64 explicit bassmod, and even then I'd need the DLL, irrKlang is x86 only, too. I'm pretty much running out of options here, I'm thankful for any suggestion. 1
Aguila Posted May 26, 2011 Posted May 26, 2011 I'm facing the same problem and I didn't find a working solution. That is a reason why everyone should hate and avoid inline assembly. This really really sucks! Using google is useless too, because it looks like every entry is refering to bassmod, fmod or ufmod.The best option I found is:Use this/>http://kode54.foobar2000.org/foo_dumb-dumb-lib_source.rardumbplay.c is a working player. The big problem is allegro: http://alleg.sourceforge.netBut I think it is still the best option to create a static lib. Haven't tried it yet. I hope the resulting filesize is small...If you have a working solution please post it.
Killboy Posted May 26, 2011 Author Posted May 26, 2011 I just had another go at googling and found some more. libmikmod, libmodplug and the milkytracker source.Maybe next week I have a few hours to try and compile and implement one of these, will update this thread with any progress. 1
Killboy Posted May 26, 2011 Author Posted May 26, 2011 I got libmodplug to compile (1 MB static lib :0) but I'm struggling to get sound to work. ufMOD source is a PITA, 5 minutes of skimming through the source gave me a rough idea but I'm nowhere near having a clue. Been fiddling around with WinMM but no luck so far. Is DirectSound a good alternative? The code looks simple but I just realized I need to get the DirectX SDK and the platform SDK to even compile. 1
Killboy Posted May 27, 2011 Author Posted May 27, 2011 (edited) After some trial and error I got libmodplug to play music, currently just reading a 20 second buffer and feeding it to waveOut. So it's really just some details to work on (thread, backbuffer, etc.) and nothing that can't be found on CodeProject The real problem however, is the size: The binary went from 140kb (static CRT!) to 340kb (linking to CRT dlls). I guess this can be tweaked a good amount by removing the entire code that deals with all the other module formats (there are tons!). While that won't be as good as ufMODs 5 or so kb but 20-30kb for the entire lib should be perfectly doable. PS: The sound is way better than uFMOD, too Edited May 27, 2011 by Killboy 1
hmi222 Posted May 27, 2011 Posted May 27, 2011 Hi Killboy!Perhaps yu can try mikwin, the port of Libmikmod.Its directsound included.to make it small yu have to clean from all other formats./>http://www.bitplanet.de/mikwin/index.html
Killboy Posted May 27, 2011 Author Posted May 27, 2011 Thanks for the link.I read that libmikmod is a little buggy but I don't plan on throwing samples at it, I only use one file for keygen background music etc. so it's perfect for my needs.Nice to see some DirectSound code, too. 1
Aguila Posted May 27, 2011 Posted May 27, 2011 (edited) you mean this thing? http://modplug-xmms.sourceforge.net/ They don't support windows I don't know much about sounds/music, so it is really difficult for me to get this working. ufmod needs only 7 imports with WINMMM and that is really great. Edited May 27, 2011 by Aguila
hmi222 Posted May 27, 2011 Posted May 27, 2011 (edited) ufmod needs only 7 imports with WINMMM and that is really great. ufmod is already used by the most keygencoders. but its not ready for 64 bit. Killboy needs a 64bit combatible lib. i think a c-lib is better to convert than a asm-lib as ufmod! @killboy: Let us know if yu're happy! Edited May 27, 2011 by hmi222
Killboy Posted May 28, 2011 Author Posted May 28, 2011 @Aguila: the lib explicitly supports MSVC and compiles without problems on both architectures. The sound part is not all that tricky, most libs are designed to produce plain old PCM data which pretty much any sound API understands. Now all you have to do is implement the WINMM code yourself, that's where I'm stuck right now. Just read that it deadlocks in some situations, so now it's full-blown threads and events. But hey, where's the fun in just grabbing stuff that works out of the box 1
Killboy Posted May 31, 2011 Author Posted May 31, 2011 Here's the result of my adventures:/>http://forum.tuts4you.com/index.php?app=blog&module=display§ion=blog&blogid=4&showentry=117 I tried getting mikmod to just output PCM to a buffer but didn't find out just how to do it the proper way, maybe sometime in the future. Thanks for your help! 1
hmi222 Posted June 11, 2011 Posted June 11, 2011 killboy can yu give this a try?ive no X64 machine.Its mikwin 64bit compiled,with all replayers.if its running we can strip it to only XM! its with directsound. yu have to include dsoundBest regardshmi222Mikwin_X64.zip
Ufo-Pu55y Posted June 12, 2011 Posted June 12, 2011 I've played some XMs, ITs, MODs and S3Ms with it.It plays everything w/o crashes, but the soundis as if it would apply 'hall' effect on everything.Also especially when playing XMs there's a noticeableclicking sound in the background: mw64.7z
Killboy Posted June 12, 2011 Author Posted June 12, 2011 yep, sounds a little bit like vinyl according to the readme it's a sync problem but I doubt that...I always figured if click sounds appear it's a ****ty decoder, or maybe some bug in the DirectSound code on new OSs or whatever
hmi222 Posted June 12, 2011 Posted June 12, 2011 yep, sounds a little bit like vinyl according to the readme it's a sync problem but I doubt that...I always figured if click sounds appear it's a ****ty decoder, or maybe some bug in the DirectSound code on new OSs or whatever I compiled to 32bit x86 as DLL with the delivered PlayerCode as ConsoleApp. I stripped it to play only XM. But the clicks too... we had a closer look into. Mikwin+DLL in 32bit x86.rar
Killboy Posted June 12, 2011 Author Posted June 12, 2011 It still clicks but I just realized that with libmodplug it clicks too, although not as heavily (just play it with VLC, it uses libmodplug) I guess it depends on the xm you're using, some were built for a specific player and others have trouble decoding it properly. Just found two more small libraries, maybe they are worth a shot:/>http://os4depot.net/share/development/library/audio/uniminixmlib.lha/>http://code.google.com/p/chibi-itplay/ The latter also supports it, s3m, mod. While I havent tested if it's functional the code does look complete, just needs some tweeks to load from memory it seems. Anyway, I got what I needed, chapter closed for me. Thanks again, guys
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now