0
0

Damn, sorry for the duplicate post – this is complete this time

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)
{
//deal with error
}

FSOUND_Stream_SetEndCallback(stream,endcallback, 0) ;

FSOUND_Stream_SetSyncCallback(stream, endcallback, 0) ;

sptr = FSOUND_Stream_GetSample(stream) ;

int channel ;

channel = -1 ;

channel = FSOUND_Stream_Play(FSOUND_FREE, stream) ;
return channel ;

Why does the function which contains the last 3 lines never return a value when called, and why does the stream not play. When I call FSOUND_GetError() ; the value of 14 is returned. I can see nothing wrong with the above code – infact it used to work on FMOD 3.6x with PPC2002. Any help or suggestions are HUGELY appriciated.

Regards,

David Glover

  • You must to post comments
0
0

Yes, after looking at my post – it was a little non-descript – it had been a long day after the upgrade of my iPaq failed! I eventually tracked the problem down to a number of things – the main problem being the path of the file I was trying to play being incorrect. I accidently set one section of code to return the same value as the success condition which made debugging it from .NET very difficult :)

All is now working fine however. Many thanks.

David

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.