Since I would like to stream mp3 through Bluetooth, I add a circular buffer for storing the mp3 data.
I use FSOUND_Stream_Create and set a callback function. In the callback, it just read the data from the buffer. (as now it’s for testing, I just read the file, write data into the circular buffer. and then read it and pass to the callback)
However the mp3 can’t be played. There is only noise. Is there any method I can do it? Thanks a lot

[code:1ibavtb2]signed char F_CALLBACKAPI CMp3Player::StreamCallback(FSOUND_STREAM *stream, void *buff, int len, int param)
DataVar *p_data = (DataVar *)param;
int datasize = p_data->p_Buffer->GetMaxReadSize();
int outputsize;
if (datasize < len)
outputsize = datasize;
else outputsize = len;

fread(p_data-&gt;tempBuf, outputsize, 1, *(p_data-&gt;pp_File));
p_data-&gt;p_Buffer-&gt;WriteBinary(p_data-&gt;tempBuf, outputsize);
p_data-&gt;p_Buffer-&gt;ReadBinary((char *)buff, outputsize);


  • You must to post comments

Thanks a lot!

  • You must to post comments

Hi Guest!

I’m just writing my final diploma exactly with this topic! (Audio transmission over bluetooth) So I’m also trying to overwrite the file callbacks… I wonder how you solved the problem – would be nice if you can get in touch with me, or probably you can post your code in here – I think many users would appreciate that!!

Thx – hope to get an answer 😉



  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.