0
0

I’m trying to loop a movement SFX for my character in my game. I dedicate a channel specifically for this effect. Load in the sound properly and play it through the channel as soon as the game starts. If the player is moving I set pause on the channel to false, and if they aren’t moving set the pause to true.

Everything works fine for about half a minute when it will just suddenly stop working. I was told this was a common problem, but the person couldn’t remember exactly how to fix it. Any help would be appreciated.

  • You must to post comments
0
0

[quote="Toole":29t9j4xv]I’m trying to loop a movement SFX for my character in my game. I dedicate a channel specifically for this effect. Load in the sound properly and play it through the channel as soon as the game starts. If the player is moving I set pause on the channel to false, and if they aren’t moving set the pause to true.

Everything works fine for about half a minute when it will just suddenly stop working. I was told this was a common problem, but the person couldn’t remember exactly how to fix it. Any help would be appreciated.[/quote:29t9j4xv]

Shot In the dark here…
Try
CreateStream
insted of
CreateSound

My sounds stop working too after a period of time if they are not streamed.

  • You must to post comments
0
0

That is not a solution, streaming vs static will not have anything to do with simply playing looping sounds.

You are probably not setting voice priorities, and are seeing voice stealing happening. Use Channel::setPriority or Sound::setDefaults to set the priority of a sound so that it doesn’t get stolen.

  • You must to post comments
0
0

Ok so I set the priority on the looping SFX channel and the sound itself to 0 and it no longer cuts out on it’s own after thirty seconds. But sometimes if another default SFX plays on a separate channel it will cut out the looping one. I set the priority on the default SFX channels to 256 yet it still happens.

  • You must to post comments
0
0

I am at my wits end. Been trying to debug this problem for weeks now and still I get no where.

The priority on my Looping SFX channel is 0, and the priority on all of my other SFX channels is 256 yet every now and then the looping sfx gets it’s sound stolen. This is happening among the regular SFXs as well. Sometimes they will steal from each other so I have no idea if they are related. What’s funny is that I have a Music channel that is setup and used the exact same way as the looping SFX channel and it has never has it’s sound stolen once.

I call the setpriority function in the init of my fmod wrapper. I have tried moving it down to right after I called playsound yet that doesn’t seem to help. I’m using the CHANNEL_REUSE flag in playsound, and passing in the reference of the channel I want to use. My number of virtual voices I create in the system init is 4093. I have no idea if somehow I’m running out.

Any help I could get would be huge. Final turn in on this game is Monday, and this is kind of a big bug.

  • You must to post comments
0
0

try using FREE instead of REUSE?

  • You must to post comments
0
0

[quote="mac_bug":3bmxb5h7]try using FREE instead of REUSE?[/quote:3bmxb5h7]

I’m not sure why but this seems to have fixed it, thanks.

  • You must to post comments
0
0

reuse and free are well defined. One reuses the channel you already played the sound on, free uses a non playing channel, or steals a channel with equal or lower priority if you have run out.

  • You must to post comments
Showing 7 results
Your Answer

Please first to submit.