Ok, first of all I know I can use FSOUND_Stream_Open to do this but I am going to be using a virtual file system and want to get my callback working with normal file functions (fopen, fseek etc) first before using the actual vfs. My code is shown below but it produces just a hissing noise.
signed char F_CALLBACKAPI streamcallback(FSOUND_STREAM *stream, void *buff, int len, void *param)
fseek(fp,len,pos); pos = pos + len; printf("Pos: %d\n",pos); printf("callback: buff = %p, len = %d\n", buff, len); return 1;
FSOUND_Init(44100,16,0); pos = 0; fp = fopen("main.mp3","rb"); stream = FSOUND_Stream_Create(streamcallback, 6*2048, FSOUND_NORMAL | FSOUND_16BITS | FSOUND_STEREO, 44100, (void *)12345); FSOUND_Stream_Play(FSOUND_FREE,stream); getch(); FSOUND_Stream_Close(stream); FSOUND_Close(); fclose(fp); return 0;
I tried to adapt the Stream2 sample to achieve my goal of streaming an mp3/ogg from disk. Could you please suggest what I am doing wrong.
- kezz asked 14 years ago
- You must login to post comments