# Getting an instance channel group or channel

**URL:** <https://qa.fmod.com/t/getting-an-instance-channel-group-or-channel/15117>\
**Category:** Unreal Engine\
**Created:** [October 9, 2019, 1:36pm UTC](https://qa.fmod.com/t/getting-an-instance-channel-group-or-channel/15117 "2019-10-09T13:36:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MaelV](https://avatars.discourse-cdn.com/v4/letter/m/f08c70/32.png) [@MaelV](https://qa.fmod.com/u/MaelV)\
**Post date:** [October 9, 2019, 1:36pm UTC](https://qa.fmod.com/t/getting-an-instance-channel-group-or-channel/15117/1 "2019-10-09T13:36:30Z")

</div>

Hello Everyone,  
I am using fmod and ue4 c++ and would like to apply a dsp effect on a channelgroup but I can’t seem to find said channelgroup depending on the event am playing.  
Basicaly, I have a function which is :

```
void UAudioAnalyzer::StartSound(UFMODEvent* InEvent)
{
	FFMODEventInstance InstanceWrapper = UFMODBlueprintStatics::PlayEvent2D(GetWorld(),InEvent,true);
	_StudioSystem = IFMODStudioModule::Get().GetStudioSystem(EFMODSystemContext::Runtime);
	FMOD::Studio::EventInstance* Instance = InstanceWrapper.Instance;

	_StudioSystem->getLowLevelSystem(&_LowLevelSystem);

	//_LowLevelSystem->getChannel(0,&_channel); //putting id 0 is getting smtg random.
	Instance->getChannelGroup(&_channelGroup); //does not return anything
     	if (_channel)
{

	_LowLevelSystem->createDSPByType(FMOD_DSP_TYPE_FFT, &_dsp);
	if (_dsp)
	{
		_dsp->setParameterInt(FMOD_DSP_FFT_WINDOWTYPE, FMOD_DSP_FFT_WINDOW_TRIANGLE);
		_dsp->setParameterInt(FMOD_DSP_FFT_WINDOWSIZE, _WINDOWSIZE);
		_channel->addDSP(0, _dsp);
		_dsp->setActive(true); //c'est vmt a foutre la ???
	}

```

It has a blueprint type of event as input, and I want to apply a dsp to its group. The getChannelGroup function from the instancewrapper.instance does not return anything. And if I simply get the channel with id “0”. I get something but it’s not relevant (it’s not the master group I guess, and its not being used).

Do anyone have a clue on how I could get the relevant channel and apply a dsp to it ?  
Thanks a lot !

---

<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:** [October 14, 2019, 10:31pm UTC](https://qa.fmod.com/t/getting-an-instance-channel-group-or-channel/15117/2 "2019-10-14T22:31:00Z")

</div>

You should check the FMOD\_RESULT returned from the FMOD functions, [`Instance->getChannelGroup`](https://fmod.com/resources/documentation-api?version=2.0&page=studio-api-eventinstance.html#studio_eventinstance_getchannelgroup) will likely be returning `FMOD_ERR_STUDIO_NOT_LOADED`.

> `Studio::EventInstance::getChannelGroup`  
> Until the event instance has been fully created this function will return [FMOD\_ERR\_STUDIO\_NOT\_LOADED](https://fmod.com/resources/documentation-api?version=2.0&page=core-api-common.html#fmod_err_studio_not_loaded).

This is because the Event Instance creation and starting are asynchronous and require time to process. You can query the playback state using [`EventInstance::getPlaybackState`](https://fmod.com/resources/documentation-api?version=2.0&page=studio-api-eventinstance.html#studio_eventinstance_getplaybackstate), once the state becomes `FMOD_STUDIO_PLAYBACK_PLAYING` the channelgroup will be available.

---

<div class="post-metadata">

**Author:** ![MaelV](https://avatars.discourse-cdn.com/v4/letter/m/f08c70/32.png) [@MaelV](https://qa.fmod.com/u/MaelV)\
**Post date:** [October 16, 2019, 9:39pm UTC](https://qa.fmod.com/t/getting-an-instance-channel-group-or-channel/15117/3 "2019-10-16T21:39:49Z")

</div>

Thanks for the answer, didn’t have the time to double check but I am using the master group from the low level system, which also works fine for now. Since I was calling play and asking for the group 2 lines apart that’s most likely the issue I had !
