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();
if (datasize < len)
outputsize = datasize;
else outputsize = len;
fread(p_data->tempBuf, outputsize, 1, *(p_data->pp_File)); p_data->p_Buffer->WriteBinary(p_data->tempBuf, outputsize); p_data->p_Buffer->ReadBinary((char *)buff, outputsize);
- Anonymous asked 13 years ago
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 😉
Please login first to submit.