GP2X Instant Sound Effect Playback


synkro

0xdeadbeef
Joined
Aug 26, 2003
Messages
823
Location
Germany
Website
Visit site
Even though I know most of you are probably using SDL_Mixer, there must be a faster, less bloated way. I tried to play samples with mikmod, but it's slow and delayed sad.gif Is there a fast way to instant playback sound effects (even low quality is fine with me)
 
MikMod's not bad at all, you just need to set the buffer to a smaller size:

CODE
drv_oss.CommandLine("buffer=11,count=6");
MikMod_RegisterDriver(&drv_oss);

md_mixfreq = 22050;
md_mode = DMODE_16BITS | DMODE_STEREO | DMODE_SOFT_MUSIC | DMODE_SOFT_SNDFX;
MikMod_Init("");


Planning to add sound to a GP2X port of Vertical? :)
 
Alex. said:
MikMod's not bad at all, you just need to set the buffer to a smaller size:

CODE
drv_oss.CommandLine("buffer=11,count=6");
MikMod_RegisterDriver(&drv_oss);

md_mixfreq = 22050;
md_mode = DMODE_16BITS | DMODE_STEREO | DMODE_SOFT_MUSIC | DMODE_SOFT_SNDFX;
MikMod_Init("");
Planning to add sound to a GP2X port of Vertical? :)

WTF?! How do you know? I hate you ....
I'll give it a try ..
 
Last edited by a moderator:
I use SDL_Mixer (dynamicly linking to library)
Just experiment with the buffer size. #ifdef this size different for gp2x and PC versions.
Only trouble - it slowdowns when mixing together two big wavs. The nice was is to use very little sound effects like 10ms or even less.
 
quasist said:
I use SDL_Mixer (dynamicly linking to library)
Just experiment with the buffer size. #ifdef this size different for gp2x and PC versions.
Only trouble - it slowdowns when mixing together two big wavs. The nice was is to use very little sound effects like 10ms or even less.
I do exactly the same thing. Here's the settings I use (work fine for me)

CODE
#ifdef GP2X
Mix_OpenAudio(44100, AUDIO_S16, 2, 512);
#endif

#ifdef WIN32
Mix_OpenAudio(44100, AUDIO_S16, 2, 2048);
#endif
 
Last edited by a moderator:
Unfathomable Depths said:
quasist said:
I use SDL_Mixer (dynamicly linking to library)
Just experiment with the buffer size. #ifdef this size different for gp2x and PC versions.
Only trouble - it slowdowns when mixing together two big wavs. The nice was is to use very little sound effects like 10ms or even less.
I do exactly the same thing. Here's the settings I use (work fine for me)

CODE
#ifdef GP2X
Mix_OpenAudio(44100, AUDIO_S16, 2, 512);
#endif

#ifdef WIN32
Mix_OpenAudio(44100, AUDIO_S16, 2, 2048);
#endif



Similar for me... I needed zero lag for my engine sound. Its about there now.
 
Last edited by a moderator:
Back
Top