0
0

Hi,

It seems that my callback for “fopen” established with FSOUND_File_SetCallbacks is receiving an invalid second argument “mode”. I get the first argument right, so this is a bit strange. I tested on both linux and windows and both seem to have the same problem.

By invalid second argument I mean that it doesn’t seem to be a pointer, my program will crash if I attemp to access the byte it points to.

Is this an known issue in 3.71? Is there anything I could be doing wrong?

Thanks a lot.

  • You must to post comments
0
0

i also can’t get it working: [quote:2mohobbo]Unhandled exception at 0x0042adea in FMODTesting.exe: 0xC0000005: Access violation writing location 0x0065c23a. [/quote:2mohobbo]
My code is:
[code:2mohobbo]#include "stdafx.h"

include <fmod.h>

include "conio.h"

pragma comment (lib,"fmodvc.lib")

unsigned int myopen(const char *name)
{
return (unsigned int)fopen(name, "rb");
}

void myclose(unsigned int handle)
{
fclose((FILE *)handle);
}

int myread(void *buffer, int size, unsigned int handle)
{
return fread(buffer, 1, size, (FILE *)handle);
}

int myseek(unsigned int handle, int pos, signed char mode)
{
return fseek((FILE *)handle, pos, mode);
}

int mytell(unsigned int handle)
{
return ftell((FILE *)handle);
}

int _tmain(int argc, _TCHAR* argv[])
{
FSOUND_File_SetCallbacks((FSOUND_OPENCALLBACK)myopen,(FSOUND_CLOSECALLBACK)myclose,
(FSOUND_READCALLBACK)myread, (FSOUND_SEEKCALLBACK)myseek, (FSOUND_TELLCALLBACK)mytell);
FSOUND_Init(44100,0,32);
FSOUND_STREAM *MyStream = FSOUND_Stream_Open(argv[1],0,0,0);
int MyChannel = FSOUND_Stream_Play(FSOUND_FREE,MyStream);
getch();
FSOUND_Stream_Stop(MyStream);
FSOUND_Stream_Close(MyStream);
FSOUND_Close();
return 0;
}[/code:2mohobbo]

It crashes after FSOUND_Init is called. If i place FSOUND_File_SetCallbacks after FSOUND_Init it will crash after FSOUND_Stream_Open. What do i wrong?
Thanks in advance

  • You must to post comments
0
0

it works! I added __stdcall to the filecallbacks ๐Ÿ˜†

  • You must to post comments
0
0

[quote="Chris":6leh7r7w]it works! I added __stdcall to the filecallbacks :lol:[/quote:6leh7r7w]

you have the F_API define ๐Ÿ˜‰

  • You must to post comments
0
0

yeah.. i noticed it was correct in the stream sample, but in the simple sample it was incorrect (from that sample i copied the code). This is probably not fixed when FMOD switched to stdcall

  • You must to post comments
0
0

euh yes, i would say F_CALLBACKAPI, sorry :roll:

  • You must to post comments
Showing 5 results
Your Answer

Please first to submit.