# Getting a sound's ID from multiinstrument Shuffle or Random playback settings?

**URL:** <https://qa.fmod.com/t/getting-a-sounds-id-from-multiinstrument-shuffle-or-random-playback-settings/22472>\
**Category:** FMOD Studio\
**Created:** [January 2, 2025, 7:41pm UTC](https://qa.fmod.com/t/getting-a-sounds-id-from-multiinstrument-shuffle-or-random-playback-settings/22472 "2025-01-02T19:41:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Johanenglund](https://avatars.discourse-cdn.com/v4/letter/j/7ea924/32.png) [@Johanenglund](https://qa.fmod.com/u/Johanenglund)\
**Post date:** [January 2, 2025, 7:41pm UTC](https://qa.fmod.com/t/getting-a-sounds-id-from-multiinstrument-shuffle-or-random-playback-settings/22472/1 "2025-01-02T19:41:48Z")

</div>

Hey fmodders!

I’m creating a test (on auditory roughness, for context) and it’d be useful to log the sound ID (presumably a float) so I can log that together with the user’s response to the question.

I can use a param and randomise from Unity to achieve something similar, but then I have to use the timeline, and it’d be easier to do this with actions. No biggie if it’s not possible.

Best

J

---

<div class="post-metadata">

**Author:** ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)\
**Post date:** [January 8, 2025, 5:20am UTC](https://qa.fmod.com/t/getting-a-sounds-id-from-multiinstrument-shuffle-or-random-playback-settings/22472/2 "2025-01-08T05:20:30Z")

</div>

Hi,

You can get the name of the currently playing asset a few ways. The dead simplest way, if you don’t mind sorting through some logging information, would be to set FMOD for Unity’s logging level to “Log”, which will log information on the created sound, including the asset name.

A more sophisticated solution is to use an event callback on sound creation to get the name of the sound. You can see how to do so in Connor’s reply to a similar question here:

> [@How can I identify the instrument / audio file that is currently playing?](https://qa.fmod.com/t/how-can-i-identify-the-instrument-audio-file-that-is-currently-playing/19251/2):
>
> Apologies, there is actually a way to retrieve the name. To retrieve the sound we will need to use a CallBack. More information about Callbacks can be read under [Studio API | Callbacks](https://fmod.com/docs/2.02/api/studio-guide.html#event-callbacks). Using your event instance you will want to assign it this callback: arrow_forward Sound Callback Assing the call back like this: FMOD.RESULT result; \_eventIntstance = FMODUnity.RuntimeManager.CreateInstance(\_eventRef); result = \_eventIntstance.setCallback(SoundCallback, FMOD.Studio.EVENT\_CALLBACK\_TYPE…

---

<div class="post-metadata">

**Author:** ![Johanenglund](https://avatars.discourse-cdn.com/v4/letter/j/7ea924/32.png) [@Johanenglund](https://qa.fmod.com/u/Johanenglund)\
**Post date:** [January 13, 2025, 4:57pm UTC](https://qa.fmod.com/t/getting-a-sounds-id-from-multiinstrument-shuffle-or-random-playback-settings/22472/3 "2025-01-13T16:57:14Z")

</div>

Hi Leah

That’s really helpful, thank you. I opted to randomise a parameter from Unity in this case, but for randomised listening tests your suggestion opens up a way to detail the analysis much more or simplifying the FMOD event structure, e.g., just using an Action with a multi instrument.
