I have in-memory sounds in Ogg Vorbis format. After the sound starts playing, I wish to change the volume setting for that sound. So I call SetVolume on the channel. This results in ERR_CHANNEL_STOLEN, "The specified channel has been reused to play another sound. "
Clearly the message description is not accurate. So what conditions can really raise this error on a SetVolume call?
(Windows Vista 32-bit, called from C#)
- m37cue asked 7 years ago
That error generally means what is says, I am not aware of an issues to cause this error to pop up.
Is it possible the channel handle got corrupted? Check the value of the ‘channelraw’ handle returned from playSound inside the wrapper, and then step through and make sure it’s still the same when you call later call setVolume.
- Guest answered 7 years ago
Now I am getting INVALID_HANDLE when I try to change the volume of a playing sound channel. The raw handle values for both SOUND and CHANNEL are unchanged from when they were created. All calls to FMOD happen in the same thread.
An initial call to setVolume, before the channel is unpaused, does work correctly. Later ones get the error. These modes are set: SOFTWARE, 3D, OPENMEMORY, NONBLOCKING, WORLDRELATIVE. If the sound is looped LOOP_NORMAL is also set.
The setup sequence is:
[code:2o4t433q]createSound, on a buffer containing Ogg Vorbis data
(wait for non-blocking callback)
playSound, initially paused
setCallback, to later catch end of sound playback
Then some time later, the user changes a volume slider, which leads to another call to setVolume on the playing sound channel.
Multiple changes in volume on a channel playing an MP3 stream work fine. But changes on playing in-memory sounds get the error.
The end-of-sound callback sets a ‘finished’ flag, which prevents any attempts to change volume on a sound that is no longer active.
Please login first to submit.