forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

mikmod

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
JJPeerless



Joined: 20 Jun 2005
Posts: 82

PostPosted: Thu Jul 21, 2005 2:44 pm    Post subject: mikmod Reply with quote

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
View user's profile Send private message
Treat



Joined: 26 Sep 2004
Posts: 16

PostPosted: Thu Jul 21, 2005 7:07 pm    Post subject: Reply with quote

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
View user's profile Send private message
develprx



Joined: 30 Jun 2005
Posts: 3

PostPosted: Sun Jul 24, 2005 9:49 am    Post subject: Reply with quote

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
View user's profile Send private message
Jim



Joined: 02 Jul 2005
Posts: 487
Location: Sydney

PostPosted: Sun Jul 24, 2005 11:27 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group