0
0

I’m using Fmod to stream in some audio. After about 20 minutes, it will stop streaming in the audio. My assumption is that the buffer is overflowing, so I would like to stop and restart my FMOD in an attempt to clear out all of it’s buffers. This does not work as expected though. Is there a step that I’m missing?

[code:2z8laje1]void Stop()
{
FMOD.RESULT result;

    if(channel != null)
    {
        result = channel.stop();
        ERRCHECK(result);
    }

    if (sound != null)
    {
        result = sound.release();
        ERRCHECK(result);
        soundcreated = false;
    }
    //Start ();


}[/code:2z8laje1]
  • You must to post comments
0
0

You are only stopping a channel and releasing a sound (in your case a stream).

If you want to completely destroy the FMOD object and start a new one my guess is : System::release

However I think it would be better to find a way to keep your stream playing … imho, it shouldn’t be stopping like that

  • You must to post comments
0
0

Hi Dani and thank you for your response! I had that System.Release() inside of an OnDisable function that wasn’t getting called. When I made sure to call that, there must have still been some garbage data inside of it. I tried this out, and it helped a lot. Thank you so much for your help. Now, when this system is set to null, I recall the start function to re-initialize everything. I do understand that this shouldn’t happen often, and I want to fix the bug where it runs out of memory. But, for now this is a great addition because if something goes wrong the user can always reset the program and hope to fix whatever problem they had without my program crashing.

[code:12r1ycga]channel = null;
sound = null;
system = null;[/code:12r1ycga]

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.