getChannel() always returns invalid handle

I’m using FMOD.System.getChannelsPlaying to see how many playing channels there are, and the value is correct, with channels increasing as I play new sfx.

When I use FMOD.System.getChannel() I get result OK, but when I try to set channel’s volume, pan or whatever else, it returns ERR_INVALID_HANDLE. That is so for every channel I get this way.

Please, anybody, help!

Don’t assume that if you have N channels playing that getChannel(x) where 0 <= x < N will return a playing channel.

getChannel() indexes the channel pool that is initialized based on the parameter passed into System::init(). The channel that your sound plays could be any member of this pool.

Just use the channel handle that you get back from playSound().