I just discovered a nice sound file format: XM
include \masm32\MasmBasic\MasmBasic.inc ; download (http://masm32.com/board/index.php?topic=94.0)
Init
UnzipInit 100
FileWrite "tmp.dll", UnzipFile(1)
Dll "tmp"
Declare bmInit, 3 Alias "BASSMOD_Init"
Declare bmFree, 0 Alias "BASSMOD_Free"
Declare bmLoad, 5 Alias "BASSMOD_MusicLoad"
Declare bmPlay, 0 Alias "BASSMOD_MusicPlay"
void bmInit(-1, 44100, 0)
.if bmLoad(1, Cat$(UnzipFile(0)), 0, 0, 8710)
void bmPlay()
Inkey "Hit any key to stop the music"
.endif
void bmFree()
FreeDll 2
Kill "tmp.dll"
EndOfCode
Plenty of sample files are at the Mod Archive (https://modarchive.org/index.php?request=view_by_rating_comments&query=10&page=6#mods). The exe includes a version of Ian Luck's BassMod.dll (https://www.un4seen.com/).
Source & exe in the first attachment, to build it you need also the second one containing the resources.
Tested on Win7-64 and Win10 - just double-click on PlayXM.exe and ignore the security warnings :biggrin:
I am not sure how to do this myself, but I believe using uFMOD would be an decent alternative. At the very least, you wouldn't have to drop a dll file as part of the program's execution.
http://ufmod.sourceforge.net (http://ufmod.sourceforge.net)
Looks interesting but I hate COM :biggrin:
; lpDSBuffer
; A pointer to an IDirectSoundBuffer. uFMOD assumes
; that it has been properly initialized to 16-bit stereo.
Quote from: jj2007 on November 22, 2017, 06:48:08 PM
Looks interesting but I hate COM :biggrin:
; lpDSBuffer
; A pointer to an IDirectSoundBuffer. uFMOD assumes
; that it has been properly initialized to 16-bit stereo.
DirectSound COM is not that bad if you ever had to deal with the ASIO COM/C/STDCALL mixture api's :badgrin:
Quote from: Siekmanski on November 22, 2017, 07:22:38 PMDirectSound COM is not that bad
COM in general is a PITA :icon_redface:
But I wasted a morning and cracked its mysteries, see attachment :greensml:
Use uFMOD and save 75776 - 24576 bytes = 51200 bytes. :greensml:
http://masm32.com/board/index.php?topic=6698.msg71751#msg71751
I did use uFMOD but forgot to remove the BassMod.dll - see new attachment. And mine has an icon ;-)
8)
Let's start making DEMOS.