# Is the FMOD\_Channel\_IsPlaying() always guaranteed to work properly?

**URL:** https://qa.fmod.com/t/is-the-fmod-channel-isplaying-always-guaranteed-to-work-properly/19315
**Category:** FMOD Engine
**Tags:** cpp
**Created:** [September 26, 2022, 9:24am UTC](https://qa.fmod.com/t/is-the-fmod-channel-isplaying-always-guaranteed-to-work-properly/19315 "2022-09-26T09:24:27Z")
**Posts on this page:** 2
**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: [September 26, 2022, 9:24am UTC](https://qa.fmod.com/t/is-the-fmod-channel-isplaying-always-guaranteed-to-work-properly/19315/1 "2022-09-26T09:24:27Z")

</div>

Do I need to set the value of the variable **isPlaying** to 0 before calling `FMOD_Channel_IsPlaying(myChannel, &isPlaying)`?

A long time ago when I used the function of the older **FMOD Ex** version, it always returned “true”.  
It caused very serious bugs in our app back then, and assigning “false” right before the `FMOD_Channel_IsPlaying()` calls solved them.

I still don’t know the exact reason for the bug, but initializing `FMOD_BOOL`s with “false” became my habit ever since.

Is the `FMOD_Channel_IsPlaying()` always guaranteed to return a correct value regardless of whether the variable’s initialized before use?

---

<div class="post-metadata">

### Author: ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)
#### Post date: [September 29, 2022, 12:24am UTC](https://qa.fmod.com/t/is-the-fmod-channel-isplaying-always-guaranteed-to-work-properly/19315/2 "2022-09-29T00:24:09Z")

</div>

Hi,

The best way to check that FMOD functions have run correctly is to use `FMOD_RESULT`. Most FMOD Functions will return a `FMOD_RESULT` which you can then debug, a full list of the return values can be found under [Core API Reference | Common](https://fmod.com/docs/2.02/api/core-api-common.html#fmod_result).

It is a good idea to initialize variables, doing so avoids the possibility of using uninitialized values which may lead to undefined behavior.

Hope this helps!
