# Bus get channel group returns undefined only until the event plays

**URL:** <https://qa.fmod.com/t/bus-get-channel-group-returns-undefined-only-until-the-event-plays/21499>\
**Category:** FMOD Studio\
**Created:** [April 14, 2024, 6:53pm UTC](https://qa.fmod.com/t/bus-get-channel-group-returns-undefined-only-until-the-event-plays/21499 "2024-04-14T18:53:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kertenkele](https://avatars.discourse-cdn.com/v4/letter/k/5fc32e/32.png) [@Kertenkele](https://qa.fmod.com/u/Kertenkele)\
**Post date:** [April 14, 2024, 6:53pm UTC](https://qa.fmod.com/t/bus-get-channel-group-returns-undefined-only-until-the-event-plays/21499/1 "2024-04-14T18:53:23Z")

</div>

In my game, I want to adjust the pitch level of all sounds according to the game **speed** , for this I get the SFX Bus and try to get the channel group with get channel group, but it always returns undefined, but if I play any event, this time it returns me id, then I set the pitch level with `sfx_channel_group.set_pitch()`, but when the event stops, `sfx_channel_group.set_pitch()` returns an invaild object error

---

<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:** [April 15, 2024, 1:13am UTC](https://qa.fmod.com/t/bus-get-channel-group-returns-undefined-only-until-the-event-plays/21499/2 "2024-04-15T01:13:00Z")

</div>

Hi,

You can use [FMOD Engine | Studio API Reference - lockChannelGroup](https://fmod.com/docs/2.02/api/studio-api-bus.html#studio_bus_lockchannelgroup) to force the system to create and keep the channel group available until unlock is called.

Hope this helps!

---

<div class="post-metadata">

**Author:** ![Kertenkele](https://avatars.discourse-cdn.com/v4/letter/k/5fc32e/32.png) [@Kertenkele](https://qa.fmod.com/u/Kertenkele)\
**Post date:** [April 16, 2024, 3:45pm UTC](https://qa.fmod.com/t/bus-get-channel-group-returns-undefined-only-until-the-event-plays/21499/3 "2024-04-16T15:45:54Z")

</div>

Hi if I use lockChannelGroup at the beginning it works but when I do unlockChannelGroup it returns undefined again. what if I do lockChannelGroup at the beginning of the game and never unlock? because I always have to adjust the pitch level of the channel group to delta time throughout the game.

---

<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:** [April 16, 2024, 10:56pm UTC](https://qa.fmod.com/t/bus-get-channel-group-returns-undefined-only-until-the-event-plays/21499/4 "2024-04-16T22:56:18Z")

</div>

> [@Kertenkele](#):
>
> lockChannelGroup at the beginning of the game and never unlock?

Locking at the beginning of the game is the way to go. However, you want to lock it again when the game ends or the FMOD system will not clean up its resources correctly. Lock can be called when the game is closing down.

Hope this helps
