SFX only plays static
Posted: Sun Sep 12, 2010 1:30 am
Hi, I'm new to NDS coding so please forgive my basic knowledge, I'm very familiar with C++ but have only coded for Intel based systems. I always look for my own answers online and only resort to this forum when I'm really stuck.
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:
So my question, does this look like all you need for MaxMod to work? Sound was the only thing I added, it compiled before and compiles now but all I hear is static for the length of the sample.
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.
Any ideas?
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.
Any ideas?