# Finding all used AudioFiles in all Events

**URL:** <https://qa.fmod.com/t/finding-all-used-audiofiles-in-all-events/16384>\
**Category:** FMOD Studio\
**Created:** [October 30, 2020, 7:47pm UTC](https://qa.fmod.com/t/finding-all-used-audiofiles-in-all-events/16384 "2020-10-30T19:47:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![LenneR](https://avatars.discourse-cdn.com/v4/letter/l/ce73a5/32.png) [@LenneR](https://qa.fmod.com/u/LenneR)\
**Post date:** [October 30, 2020, 7:47pm UTC](https://qa.fmod.com/t/finding-all-used-audiofiles-in-all-events/16384/1 "2020-10-30T19:47:09Z")

</div>

Hi,

I’m trying to figure out how to find out which AudioFiles are referenced in an Event. I can’t really find out how they are related to each other.

I got all events the following way:

> var allEvents = studio.project.model.Event.findInstances();

But how to get a list of all AudioFiles they reference?

Thanks.

---

<div class="post-metadata">

**Author:** ![richard\_simms](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/richard_simms/32/261_2.png) [@richard\_simms](https://qa.fmod.com/u/richard_simms)\
**Post date:** [November 9, 2020, 1:00am UTC](https://qa.fmod.com/t/finding-all-used-audiofiles-in-all-events/16384/2 "2020-11-09T01:00:43Z")

</div>

This requires to drill down from the event to the group tracks to the instruments. Use this as a starter function, it only returns single instruments and doesn’t say which parameter sheet they are found on. Finding audio files in scatterer/multi instruments requires you to drill down further, but use the `dump()` function on them to find out where they are stored.

```
allEvents.forEach(function(event) {
  eventPath = event.getPath();
  console.log(eventPath + " assets:");
  allTracks = event.groupTracks;
  allTracks.forEach(function(track) {
    allInstruments = track.modules;
    allInstruments.forEach(function(instrument) {
      if(instrument.audioFile !== undefined) {
        console.log(" " + instrument.audioFile.assetPath);
      }
    });
  });
});
```
