can someone explain or show sample of mikmod playing a wav file on the psp..
i cant figure out how to include all the right files..
mikmod
it can be done i believe. you load the appropriate drivers first for the WAV format.
you pass your wave file to
the rest of the init stuff can be taken from the samples, but these are the only things that deviate from that in terms of loading a wav. if you want to link the wav to the binary as an extern and have it play from memory, you will have to modify mmio.c (the function responsible for opening a music file) to support loading from memory. I normally don't use wavs as they are bulky, but if anything, it can be done like this.
Code: Select all
MikMod_RegisterLoader(load_wav);
MikMod_RegisterDriver(drv_psp);
Code: Select all
MikMod_LoadSong("ms0:/mywav.wav",0xFF);
From the docs for mikmod (untested code)
Jim
Code: Select all
SAMPLE *sound01;
int voice;
MikMod_RegisterLoader(load_wav);
sound01 = WAV_LoadFN("sound01.wav");
voice = MikMod_PlaySample(sound01, 0, 0);
//enable the mixer
playing=1;
//delay while sound plays
//use Voice_*() api to change how sfx is played
WAV_Free(sound01);