# createStream sound and FMOD studio groups/bus

**URL:** <https://qa.fmod.com/t/createstream-sound-and-fmod-studio-groups-bus/18498>\
**Category:** Unreal Engine\
**Created:** [March 9, 2022, 10:38pm UTC](https://qa.fmod.com/t/createstream-sound-and-fmod-studio-groups-bus/18498 "2022-03-09T22:38:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jblaswu](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jblaswu/32/1117_2.png) [@jblaswu](https://qa.fmod.com/u/jblaswu)\
**Post date:** [March 9, 2022, 10:38pm UTC](https://qa.fmod.com/t/createstream-sound-and-fmod-studio-groups-bus/18498/1 "2022-03-09T22:38:21Z")

</div>

We are currently succesfully creating a stream. The stream is fed with another function that renders audio. Everything works fine and the audio is played fine. The issue that we are having now is that we would want it to be part of a group/bus that is previously set on FMOD Studio. For example we got a group called Music, and a global variable that controls that volume.  
Is there any way to do this with c++? we are using UE4  
Also, we did try using programmer sounds but it the result is not very good on some platforms so we are trying to stop using that approach

---

<div class="post-metadata">

**Author:** ![jblaswu](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jblaswu/32/1117_2.png) [@jblaswu](https://qa.fmod.com/u/jblaswu)\
**Post date:** [March 10, 2022, 1:57am UTC](https://qa.fmod.com/t/createstream-sound-and-fmod-studio-groups-bus/18498/2 "2022-03-10T01:57:26Z")

</div>

Found out that if i force playing the original fmod event i had with the programmer instrument (but don’t feed it) and then try to get on tick the channel group i can finally set it to my own stream. This works but feels really hacky. The original fmod event is the onlyone that exists on that group.  
Edit: Ended up binding to the FMOD\_STUDIO\_EVENT\_CALLBACK\_CREATED callback type, inside that i create my stream and use the channel group of that event. However i still feel hacky that i need to start the event. Channel groups are not initialized if no event is active?

```
	if (FMOD::Studio::System* StudioSystem = IFMODStudioModule::Get().GetStudioSystem(EFMODSystemContext::Runtime))
	{
		FMOD::ChannelGroup* currentGroup;
		FMODChannel->getChannelGroup(&currentGroup);
		FMOD::ChannelGroup* musicGroup;
		FMOD::Studio::Bus* bus;
		FMOD_RESULT result = StudioSystem->getBus("bus:/Music", &bus);
		bus->getChannelGroup(&musicGroup);
		if (musicGroup != currentGroup)
		{
			FMODChannel->setChannelGroup(musicGroup);
		}
	}
```

---

<div class="post-metadata">

**Author:** ![jeff\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeff_fmod/32/1766_2.png) [@jeff\_fmod](https://qa.fmod.com/u/jeff_fmod)\
**Post date:** [March 16, 2022, 12:23am UTC](https://qa.fmod.com/t/createstream-sound-and-fmod-studio-groups-bus/18498/3 "2022-03-16T00:23:51Z")

</div>

Good to hear you found a way to implement this, even though it feels hacky. You can ensure Channel groups are initialized without an event by calling [`Studio::Bus::lockChannelGroup`](https://fmod.com/resources/documentation-api?version=2.02&page=studio-api-bus.html#studio_bus_lockchannelgroup). Because this is all done asynchronously you will need to call [`Studio::System::flushCommands`](https://fmod.com/resources/documentation-api?version=2.02&page=studio-api-system.html#studio_system_flushcommands) for it to be created immediately.

---

<div class="post-metadata">

**Author:** ![jblaswu](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jblaswu/32/1117_2.png) [@jblaswu](https://qa.fmod.com/u/jblaswu)\
**Post date:** [March 16, 2022, 2:44pm UTC](https://qa.fmod.com/t/createstream-sound-and-fmod-studio-groups-bus/18498/4 "2022-03-16T14:44:12Z")

</div>

flushCommands was all that i was missing, thanks!
