JyCet
Member
Hi all,
Now I test how work mikmod library without SDL_mixer (I really dislike this lib)
Here the test code
The compilation is OK, but the gpe give a big music.raw file on the SD.
First idea, the mikmod driver is not correct to ear the sound but which one is correct for GP2X hardware?
Second idea mikmod lib need a little SDL sound initialisation ?
Now I test how work mikmod library without SDL_mixer (I really dislike this lib)
Here the test code
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <SDL/SDL.h>
#include <mikmod.h>
MODULE *module;
int main(int argc, char *argv[])
{
SDL_Init(SDL_INIT_JOYSTICK | SDL_INIT_VIDEO | SDL_INIT_AUDIO);
ecran = SDL_SetVideoMode(320, 240, 16, SDL_HWSURFACE | SDL_DOUBLEBUF);
SDL_ShowCursor (0); //desactive souris
SDL_JoystickOpen(0);
MikMod_RegisterAllDrivers();
MikMod_RegisterLoader(&load_mod);
md_mode |= DMODE_SOFT_MUSIC;
MikMod_Init("");
module = Player_Load("sommar.mod", 32, 0 );
if (module) {
Player_Start(module);
while (Player_Active()){
MikMod_Update();
}
Player_Stop();
Player_Free(module);
}else printf("impossible de lire le module\n");
MikMod_Exit();
SDL_JoystickClose(0);
chdir("/usr/gp2x");
execl("gp2xmenu","gp2xmenu",NULL);
SDL_Quit();
return 0;
}
The compilation is OK, but the gpe give a big music.raw file on the SD.
First idea, the mikmod driver is not correct to ear the sound but which one is correct for GP2X hardware?
Code:
MIKMODAPI extern struct MDRIVER drv_nos; /* no sound */
MIKMODAPI extern struct MDRIVER drv_pipe; /* piped output */
MIKMODAPI extern struct MDRIVER drv_raw; /* raw file disk writer [music.raw] */
MIKMODAPI extern struct MDRIVER drv_stdout; /* output to stdout */
MIKMODAPI extern struct MDRIVER drv_wav; /* RIFF WAVE file disk writer [music.wav] */
MIKMODAPI extern struct MDRIVER drv_aiff; /* AIFF file disk writer [music.aiff] */
MIKMODAPI extern struct MDRIVER drv_ultra; /* Linux Ultrasound driver */
MIKMODAPI extern struct MDRIVER drv_sam9407; /* Linux sam9407 driver */
MIKMODAPI extern struct MDRIVER drv_AF; /* Dec Alpha AudioFile */
MIKMODAPI extern struct MDRIVER drv_aix; /* AIX audio device */
MIKMODAPI extern struct MDRIVER drv_alsa; /* Advanced Linux Sound Architecture (ALSA) */
MIKMODAPI extern struct MDRIVER drv_esd; /* Enlightened sound daemon (EsounD) */
MIKMODAPI extern struct MDRIVER drv_hp; /* HP-UX audio device */
MIKMODAPI extern struct MDRIVER drv_oss; /* OpenSound System (Linux,FreeBSD...) */
MIKMODAPI extern struct MDRIVER drv_sgi; /* SGI audio library */
MIKMODAPI extern struct MDRIVER drv_sun; /* Sun/NetBSD/OpenBSD audio device */
MIKMODAPI extern struct MDRIVER drv_dart; /* OS/2 Direct Audio RealTime */
MIKMODAPI extern struct MDRIVER drv_os2; /* OS/2 MMPM/2 */
MIKMODAPI extern struct MDRIVER drv_ds; /* Win32 DirectSound driver */
MIKMODAPI extern struct MDRIVER drv_win; /* Win32 multimedia API driver */
MIKMODAPI extern struct MDRIVER drv_mac; /* Macintosh Sound Manager driver */
MIKMODAPI extern struct MDRIVER drv_osx; /* MacOS X CoreAudio Driver */
Second idea mikmod lib need a little SDL sound initialisation ?