Please help me!
If I convert my sounds to c source code and include them into my main .fxe file the sounds work almost fine (except for the annoying clicking sound)
but,
if I convert them to .sef files and load them into an unsigned short pointer (unsigned short*) I either get silence or servere static. I've also tried converting them into raw format but when the game tries to load or play them (i'm not sure which) it stalls the GP32.
What am I doing wrong?
Both are exactly the same except that one has the c source code built-in to the .fxe and the other loads the sef files seperately from the main .fxe file.
here is my code:
GpPcmInit(PCM_M22,PCM_8BIT);
GpFatInit();
//Initialise
F_HANDLE fh;
ERR_CODE err;
unsigned long n_size,n_read;
char * app_path;
flag = 1;
#if GP_DBG
GpAppPathSet("gp:\\game\0", 20);
#endif
app_path = GpAppPathGet(NULL);
//clean the screen
GpRectFill(NULL, &gpDraw[0], 0, 0, 320, 240, 0x00);
GpRectFill(NULL, &gpDraw[1], 0, 0, 320, 240, 0x00);
//Load the Rain Fade in Sound
err = GpFileOpen("gp:\\Game\\GpThug\\Sound\\Intro\\RainFade.snd",OPEN_R,&fh);
err = GpFileRead(fh, & n_size, 4, & n_read);
err = GpFileRead(fh, & n_size, 4, & n_read);
RainFade = (unsigned short *)gp_mem_func.malloc(n_size);
err = GpFileRead(fh, RainFade, n_size, & n_read);
GpFileClose(fh);
GpPcmPlay((unsigned short*)RainFade, sizeof(RainFade), 0);
If I convert my sounds to c source code and include them into my main .fxe file the sounds work almost fine (except for the annoying clicking sound)
but,
if I convert them to .sef files and load them into an unsigned short pointer (unsigned short*) I either get silence or servere static. I've also tried converting them into raw format but when the game tries to load or play them (i'm not sure which) it stalls the GP32.
What am I doing wrong?
Both are exactly the same except that one has the c source code built-in to the .fxe and the other loads the sef files seperately from the main .fxe file.
here is my code:
GpPcmInit(PCM_M22,PCM_8BIT);
GpFatInit();
//Initialise
F_HANDLE fh;
ERR_CODE err;
unsigned long n_size,n_read;
char * app_path;
flag = 1;
#if GP_DBG
GpAppPathSet("gp:\\game\0", 20);
#endif
app_path = GpAppPathGet(NULL);
//clean the screen
GpRectFill(NULL, &gpDraw[0], 0, 0, 320, 240, 0x00);
GpRectFill(NULL, &gpDraw[1], 0, 0, 320, 240, 0x00);
//Load the Rain Fade in Sound
err = GpFileOpen("gp:\\Game\\GpThug\\Sound\\Intro\\RainFade.snd",OPEN_R,&fh);
err = GpFileRead(fh, & n_size, 4, & n_read);
err = GpFileRead(fh, & n_size, 4, & n_read);
RainFade = (unsigned short *)gp_mem_func.malloc(n_size);
err = GpFileRead(fh, RainFade, n_size, & n_read);
GpFileClose(fh);
GpPcmPlay((unsigned short*)RainFade, sizeof(RainFade), 0);