# About accessing an old channel

**URL:** <https://qa.fmod.com/t/about-accessing-an-old-channel/13836>\
**Category:** FMOD Engine\
**Created:** [April 23, 2018, 7:10pm UTC](https://qa.fmod.com/t/about-accessing-an-old-channel/13836 "2018-04-23T19:10:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jiyongman](https://avatars.discourse-cdn.com/v4/letter/j/ebca7d/32.png) [@jiyongman](https://qa.fmod.com/u/jiyongman)\
**Post date:** [April 23, 2018, 7:10pm UTC](https://qa.fmod.com/t/about-accessing-an-old-channel/13836/1 "2018-04-23T19:10:47Z")

</div>

So far I’ve never had any problem so haven’t thought about this at all,  
but suddenly became curious, if calling FMOD\_Channel\_IsPlaying() after a long period of time can cause any problem, or at least return a wrong value when the sound is already stopped.

When FMOD\_System\_Init() is called, requested numbers of channels will be created in FMOD\_SYSTEM. And when FMOD\_System\_PlaySound() is called, it’ll work just like FMOD Ex’s FMOD\_CHANNEL\_FREE, so a pointer to a free channel will be returned.  
When no channels are available, _channel stealing_ will occur, stopping one of the sounds whose priority is the lowest.

This is what I know.  
So, I think channel related functions can’t guarantee their behavior 100%, even though most of the time this won’t be any problem at all with enough channels and good code.  
FMOD\_Channel\_IsPlaying() may return TRUE if some other sound is reusing the same channel.  
FMOD\_Channel\_SetVolume() may affect the other sound too after reaching the end or calling FMOD\_Channel\_Stop().

Is my theory wrong?

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [April 26, 2018, 4:51am UTC](https://qa.fmod.com/t/about-accessing-an-old-channel/13836/2 "2018-04-26T04:51:27Z")

</div>

The maxChannels argument passed into FMOD::System:init() is the maximum number of channels to be used in FMOD.  
This should always be larger than the maximum number of events you want to use at any one point, the system will error if you exceed this number.

You can find more information in our API reference: [https://fmod.com/resources/documentation-api?page=content/generated/FMOD\_System\_Init.html#/](https://fmod.com/resources/documentation-api?page=content/generated/FMOD_System_Init.html#/)

> Virtual channels. These types of voices are the ones you work with using the FMOD::Channel API. The advantage of virtual channels are, unlike older versions of FMOD, you can now play as many sounds as you like without fear of ever running out of voices, or playsound failing. You can also avoid 'channel stealing' if you specify enough virtual voices.

---

<div class="post-metadata">

**Author:** ![jiyongman](https://avatars.discourse-cdn.com/v4/letter/j/ebca7d/32.png) [@jiyongman](https://qa.fmod.com/u/jiyongman)\
**Post date:** [April 26, 2018, 11:00am UTC](https://qa.fmod.com/t/about-accessing-an-old-channel/13836/3 "2018-04-26T11:00:16Z")

</div>

> [@](#):
>
> The maxChannels argument passed into FMOD::System:init() is the maximum number of channels to be used in FMOD.  
> This should always be larger than the maximum number of events you want to use at any one point, the system will error if you exceed this number.
> 
> You can find more information in our API reference: [https://fmod.com/resources/documentation-api?page=content/generated/FMOD\_System\_Init.html#/](https://fmod.com/resources/documentation-api?page=content/generated/FMOD_System_Init.html#/)
> 
> > Virtual channels. These types of voices are the ones you work with using the FMOD::Channel API. The advantage of virtual channels are, unlike older versions of FMOD, you can now play as many sounds as you like without fear of ever running out of voices, or playsound failing. You can also avoid 'channel stealing' if you specify enough virtual voices.

Thanks!
