0
0

I initialize FMod with FSOUND_OUTPUT_NOSOUND_NONREALTIME to decode a file when I need it.
I open a stream and add a stream dsp so that I can capture the decoded data and store it in my own buffer.
This way I can get my own stream buffer system with a few minutes of buffer.

The problem that I’m getting though is that on my Athlon 1Ghz, there are sometimes skips in the decoded audio.
I haven’t got this problem yet on my Athlon XP 1600+ though, so I was thinking that maybe frames are being skipped if FSOUND_Update is called while the stream dsp callback is not finished yet.

There is a chance that there’s something wrong with my code, but I just wanted to be sure.

  • You must to post comments
0
0

Thanks
I’ve tested that, but unfortunately it didn’t solve the problem.

I have 2 modes of loading a song in my program, 1 mode in which the song is just uncompressed entirely into memory (I reserve memory for the entire uncompressed stream, and then I fill it with data from fmod’s stream dsp callback)
I didn’t have these problems in this mode yet, but this mode is not suited for pc’s with little RAM.
The other mode reserves a buffer of about 20 MB per song, and fills it with the stream dsp callback until it is about 70% filled.
After that the song is paused with FSOUND_SetPaused, until more data is needed to fill the buffer again.

Now I was thinking, might it be possible that when pausing and unpausing the song, that a certain fragment is decoded twice, and thus that I get some data 2 times in the dsp callback?

  • You must to post comments
0
0

So, would it be possible that on pausing/unpausing the same data is sent to the stream dsp callback twice, or maybe some data skipped?

  • You must to post comments
0
0

Yes, it’s possible that some updates are called between the paused=true and paused=false.
The reason is that sometimes I need to buffer more than one stream at once.

I have recorded the glitch so I could analyse better what is actually happening, and when I look at it in cool edit, the glitch appears to be a gap, just some zero-samples in between the data.

  • You must to post comments
0
0

ok, I’ve tried replacing the pauses with setfrequency 5’s, and the problem remains.
I don’t think it’s an fmod problem anymore, probably something wrong with my circular buffer code.

Thanks for the replies!

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.