| View previous topic :: View next topic |
| Author |
Message |
JJPeerless
Joined: 20 Jun 2005 Posts: 82
|
Posted: Thu Jul 21, 2005 2:44 pm Post subject: mikmod |
|
|
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.. |
|
| Back to top |
|
 |
Treat
Joined: 26 Sep 2004 Posts: 16
|
Posted: Thu Jul 21, 2005 7:07 pm Post subject: |
|
|
| Ehm I think mikmod only play modules, but you could make a mod (use a tracker) with you wav as a sample. |
|
| Back to top |
|
 |
develprx
Joined: 30 Jun 2005 Posts: 3
|
Posted: Sun Jul 24, 2005 9:49 am Post subject: |
|
|
it can be done i believe. you load the appropriate drivers first for the WAV format.
| Code: | MikMod_RegisterLoader(load_wav);
MikMod_RegisterDriver(drv_psp); |
you pass your wave file to
| Code: | | MikMod_LoadSong("ms0:/mywav.wav",0xFF); |
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. |
|
| Back to top |
|
 |
Jim

Joined: 02 Jul 2005 Posts: 487 Location: Sydney
|
Posted: Sun Jul 24, 2005 11:27 am Post subject: |
|
|
From the docs for mikmod (untested code)
| Code: |
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);
|
Jim _________________ http://www.dbfinteractive.com |
|
| Back to top |
|
 |
|