How to select a specific audio asset programmatically?

I have hundreds of audio assets, and I need to be able to select a specific few at a time.

I have no problem loading these assets and doing this with Unity, but unity has some weird bug with crackling sounds on android.

How can I do this with FMOD? I Imported all of them into the assets tab in FMOD Studio, but I see no way to reference them in Unity. I can only find Events, and even if the event has a multi-instrument playlist I still can’t select a specific audio asset.

You can’t do this with a multi-instrument. You can import your assets as separate events by right-clicking on your assets:

But the probably best method for what you’re looking for is by using a unique event containing a programmer instrument, which will allow to set the audio asset in the game code at runtime.

Just as Alcibiade says, programmer instruments are a tool designed specifically for what you’re trying to do. They’re called “programmer instruments” because they allow your game’s code (and thus your game’s programmers) to specify which audio file should play whenever the instrument is triggered.

If you’re only going to use an asset through a programmer instrument, it’s not necessary to import that asset into the assets tab. For most purposes, you should instead add an audio table to one of the banks in your project. Each audio table points to specific source directory; when you build the bank, all the audio files in that directory are included in the bank, even if they’re not otherwise used in your project. Any asset included in a bank in this way can be used by programmer instruments.

For more information about using programmer instruments in your game’s code, see the FMOD API User Manual.

(Programmer instruments can also play loose audio files found on the player’s drive. This option is best reserved for sounds you can’t prepare in advance of distribution - for example, sound files recorded or supplied by the player - as loose audio files don’t benefit from bank encoding and compression.)