I'm trying to get a sound effect to play with MaxMod. It seem ludicracly simple to use, I don't know where the problem is.
The relivant code (I left EVERYTHING else out, there are other inlcudes, etc.) in my program is as follows:
Code: Select all
#include <maxmod9.h> /* Sounds */ #include "soundbank.h" #include "soundbank_bin.h" ... mmInitDefaultMem((mm_addr)soundbank_bin); mmLoadEffect(SFX_AHHH); mm_sound_effect sound; sound.id = SFX_AHHH; // sample ID (make sure it is loaded) sound.rate = 0x400/2; // playback rate, 1024 = original sound sound.handle = 0; // 0 = allocate new handle sound.volume = 255; // 200/255 volume level sound.panning = 128; mmEffectEx( &sound );
The sample I'm using is a 44,100Hz 16 bit Stereo PCM WAV, .401 secs long with a file size of 70,786 bytes.