0
0

Hi,

I have just upgraded my iPaq to Windows Mobile 2003 and have started to my FMOD Wrapper DLL which wraps FMOD in such a way that certain functions are availible to a .NET application.

My problem is this – consider the following code (which is spread through various functions):

//Start FMOD dealings here:
if(!FSOUND_Stream_SetBufferSize(1000))
{
… //Deal with this error

}

while(!FSOUND_Init(22050, 48, FSOUND_INIT_GLOBALFOCUS) && retrycount < 10)
{
Sleep(100) ;
retrycount++ ;
}

FILE *fp;
int length;
fp = fopen(filename, “rb”);
if (!fp)
{
printf(“Error!\n”);
printf(“File Not Found\n”);
FSOUND_Close();
return 1;
}
fseek(fp, 0, SEEK_END);
length = ftell(fp);
fseek(fp, 0, SEEK_SET);

data = (char *)malloc(length);
fread(data, length, 1, fp);
fclose(fp);

stream = FSOUND_Stream_Open(data, FSOUND_NORMAL | FSOUND_MPEGACCURATE | FSOUND_LOADMEMORY, 0, length);


if(stream == NULL)
{
    //printf("Stream creation error - failed on _OpenFile\n") ;
    return 6 ;
}

FSOUND_Stream_SetEndCallback(stream,endcallback, 0) ;

FSOUND_Stream_SetSyncCallback(stream, endcallback, 0) ;

sptr = FSOUND_Stream_GetSample(stream) ;
  • You must to post comments
Showing 0 results
Your Answer

Please first to submit.