# How to know if a sound is really played

**URL:** <https://qa.fmod.com/t/how-to-know-if-a-sound-is-really-played/16018>\
**Category:** Unity\
**Tags:** unity\
**Created:** [July 27, 2020, 9:38pm UTC](https://qa.fmod.com/t/how-to-know-if-a-sound-is-really-played/16018 "2020-07-27T21:38:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Notsu](https://avatars.discourse-cdn.com/v4/letter/n/e56c9b/32.png) [@Notsu](https://qa.fmod.com/u/Notsu)\
**Post date:** [July 27, 2020, 9:38pm UTC](https://qa.fmod.com/t/how-to-know-if-a-sound-is-really-played/16018/1 "2020-07-27T21:38:18Z")

</div>

Hi there.

In my game I have several characters with voices, I want voices to don’t overlap, so in fmod studio I created groups ( bus ) , put all my voices in this group set max instances to 1 and set stealing : None for this group.

This works fine. But now I want the character to show a bubble if he talks, so I need a callback from fmod to know if that character has talked.  
I get stick there, I tried to use EventInstance::setCallback :

- with a lambda ( to get reference to my Character instance inside of my callback function ) but this crash.
- with a static callback function , in addition to EventInstance::setUserData, but I’m stick to using properly IntPtr to point to my Character instance.

I also tried to get informatiosn about the bus so I can know how many instances it gets ( via RuntimeManager.GetBus ) but we don’t have enough details about bus in the api… ( nothin about instance count … )

Do you have any advice in how to implement this ? Thx.

---

<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:** [August 3, 2020, 10:51pm UTC](https://qa.fmod.com/t/how-to-know-if-a-sound-is-really-played/16018/2 "2020-08-03T22:51:55Z")

</div>

You should be able to use callbacks to be notified when an event occurs, see the [Programmer sound example](https://www.fmod.com/resources/documentation-unity?version=2.0&page=examples-programmer-sounds.html) which makes use of [FMOD.Studio.EVENT\_CALLBACK\_TYPE](https://fmod.com/resources/documentation-api?version=2.0&page=studio-api-eventinstance.html#fmod_studio_event_callback_type).
