# Audio Stream to programmer instrument

**URL:** <https://qa.fmod.com/t/audio-stream-to-programmer-instrument/20519>\
**Category:** Unity\
**Created:** [August 9, 2023, 1:26pm UTC](https://qa.fmod.com/t/audio-stream-to-programmer-instrument/20519 "2023-08-09T13:26:00Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [August 15, 2023, 3:31am UTC](https://qa.fmod.com/t/audio-stream-to-programmer-instrument/20519/4 "2023-08-15T03:31:09Z")

</div>

Hi,

Thank you for the explanation. This can still be done on the sound rather than using a programmer instrument.

In the Video playback example, we play the sound on the `MasterChannelGroup`. Instead what we want to do is create a new group for the video audio:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/b/b503f7df9998b4b271d867b02e79588da9017885.png)

The only difference is we will want to call `lockChannelGroup()` ([FMOD Engine | Studio API Reference - Bus::lockChannelGroup](https://fmod.com/docs/2.02/api/studio-api-bus.html#studio_bus_lockchannelgroup)) which will ensure that the channel group is kept in memory when we attach the sound. Here is how I retrieved the channel group:

```auto
FMODUnity.RuntimeManager.StudioSystem.getBus("bus:/VideoGroup", out FMOD.Studio.Bus videoGroupBus);
if (videoBus.isValid())
{
	videoBus.lockChannelGroup();
	FMODUnity.RuntimeManager.StudioSystem.flushCommands();

	videoBus.getChannelGroup(out FMOD.ChannelGroup videoChannelGroup);
}
else
{
	Debug.Log("Failed to lock Channel Group");
}

```

You will notice I also call `flushCommands()` ([FMOD Engine | Studio API Reference - System::flushCommands](https://fmod.com/docs/2.02/api/studio-api-system.html#studio_system_flushcommands)) which ensures that the lock command is called before the next update.

Just remember to attach your sound to the `videoChannelGroup` as we do to the `mMasterChannelGroup` and to `unlock` the channel group at some point.

Hope this helps!

---

_[View the full topic](https://qa.fmod.com/t/audio-stream-to-programmer-instrument/20519)._
