raysan5 / raylib

A simple and easy-to-use library to enjoy videogames programming
http://www.raylib.com
zlib License
20.8k stars 2.13k forks source link

[audio] Is there any support for libxmp, since it has a lite version for game dev? #3135

Closed Lucas-Marcel closed 1 year ago

Lucas-Marcel commented 1 year ago

I'm not a programmer and i'm having a hard time trying to figure out how to integrate them together. It works great with sdl2 cause it's nativelly integrated.

Peter0x44 commented 1 year ago

Raylib uses jar_xm.h and jar_mod.h to play xm and mod respectively does this library do something specific you need, that raylib can't?

chriscamacho commented 1 year ago

does this library do something specific you need, that raylib can't?

absolutely, allows access to song position as well as channel info in real time, additionally allows you to reserve extra channels to play multiple sound effects at the same time...

raysan5 commented 1 year ago

I'm afraid integration of libxmp is out of scope for raylib. raylib only integrates single-file header-only C libraries with a permissive license.

Lucas-Marcel commented 1 year ago

Yeah it's a single header file: "xmp.h". its written in c, i'm not sure about license though.

raysan5 commented 1 year ago

@Lucas-Marcel I'm afraid it's not a single-file header-only library, checking the repo, the library consists of many .c files in the src directory. A single-file header-only library consists of only one .h file including header and implementation.

About the LICENSE, libxmp seems to be using LGPLv2, unfortunately that license is not compatible with raylib due to the restrictions impossed for static linking.

Lucas-Marcel commented 1 year ago

Ohh thats sad. I understand now. Libxmp seems to be the best library when it comes to tracker files though.

orcmid commented 1 year ago

@chriscamacho @Lucas-Marcel You might see if there is a configuration of miniaudio.h and some of the additional src/external/ files that will do what is wanted. The engine mechanism might work for multi-channel mix/control. It has been so long since I used trackers (at least 25 years) that I have not saved any of them and don't have any players. :smile: I am a bit surprised they are still used, although I can understand the appeal.

PS: Oh Wow. Modplug -> OpenMPT, Fasttracker -> MilkyTracker. Fascinatng. And with VSTs, use in Ableton, whatever. Amazing. I can see the appeal though. I assume the compactness of tracker files is a benefit in providing game sounds.
https://drummachineguy.com/top-trackers-7-of-the-best-music-trackers-2022/.

gen2brain commented 1 year ago

I don't see how libxmp is related to raylib. Nice single header library would be great, and that exists already. Libxmp is not related?

Lucas-Marcel commented 1 year ago

@orcmid thanks, i'll take a look. I use openmpt, i think it's the most complete one out there and you can use vsts. Yeah, trackers are cool.

chriscamacho commented 1 year ago

@orcmid - I went to significant trouble to implement multi channel audio in raylib no idea why its reverted to being monophonic again - big regression, rather than reimplement that again I'd rather just disable raylibs audio and use openAL static linking on multiple platforms is not an issue, and its easy enough to use...

orcmid commented 1 year ago

@chriscamacho > @orcmid - ... I'd rather just disable raylibs audio and use openAL static linking on multiple platforms is not an issue, and its easy enough to use...

That's interesting, Chris. Fortunately, I don't think I will be getting far into audio. The openAL and openAL Soft packages have licenses I prefer not to use with code I make in the open.

Lucas-Marcel commented 1 year ago

@orcmid Thanks for the tips, after almost 1 month and almost nothing related on the internet. i managed to implement lixmp along with miniaudio, lol. made a small cli to play trackers. I can finally use libxmp and raylib together. By the way can i disable raylib's audio? Maybe i missed that when building with cmake.

Peter0x44 commented 1 year ago

comment out the line: #define SUPPORT_MODULE_RAUDIO 1 in src/config.h, and then build raylib again.

Lucas-Marcel commented 1 year ago

@Peter0x44 Thanks