Allright, I'm sorry for not posting my previous attempt, but that would confuse you all even more, and there would be a huge case of the X/Y problem (look it up).What do I want to do?
I want to play SongEight.mod and SongThree.xm in QB64 using LibXMP and OpenAL together (or in a way that QB64 could play soundbuffers returned by LibXMP).
If you have an alternative to LibXMP and/or OpenAL then I'm happy to use it.Why wouldn't you use .WAV or .OGG?
Because I wan't to keep the small filesize, and I'd also like to allow people to open up the modules and see whats inside. Yep, not gonna use another format ;PLinks
LibXMP - http://xmp.sourceforge.net
OpenAL - openal.orgNotes
Files are in the attachments. (Sorry for the DLL's, I am creating this currently on Windows yes)
I use LibXMP-lite 4.3.9, the DLL in the attachment is compiled by myself.My unfinished attempt, it returns an error (-6, which means "System Error", probably the whole thing was broken in the first place). when I try to load a module
DECLARE DYNAMIC LIBRARY "libxmp"
FUNCTION xmp_create_context%& ()
SUB xmp_free_context (BYVAL xmp_context AS _OFFSET)
FUNCTION xmp_load_module%(BYVAL xmp_context AS _OFFSET, filename AS _OFFSET)
SUB xmp_get_frame_info (BYVAL xmp_context AS _OFFSET, BYVAL xmp_frame_info AS _OFFSET)
'Reserve some memory for the xmp_frame_info struct
DIM xmp_frame_info AS _MEM
xmp_frame_info = _MEMNEW(1608)
'Create xmp_context pointer
DIM xmp_context AS _OFFSET
xmp_context = xmp_create_context
'Open the module and write it to a file
OPEN "out.raw" FOR BINARY AS #1
DIM filename as STRING
filename$ = "SongEight.mod" + CHR$(0)
if NOT xmp_load_module(xmp_context, _OFFSET(filename$)) = 0 THEN
PRINT "ERROR: xmp_load_module:"; xmp_load_module(xmp_context, _OFFSET(filename$))
xmp_get_frame_info context, frameinfo.OFFSET
'PRINT _MEMGET(frameinfo, frameinfo.OFFSET, STRING * 1608)