Best Practices

 

First off, make sure to read the Audio Origin page fully to understand the next sections.

Here are some best practices for using Master Audio!

     
  1. Normally, all Audio Clips in Playlists would be set as 2D sounds (this is done in Project View or in bulk with Bulk Audio Importer) so that you don't have to worry about 3d settings (i.e. distance of the Playlist Controller from the Audio Listener affecting volume and pitch). This setting is not on Audio Clips and is controlled by "Spatial Blend Rule" controls in Master Audio.
  2.  
  3. Determine if you will need to play music or sound effect across Scene changes.
       
    • If you don't need that, you will put a Master Audio (MA) game object and Playlist Controller (PC) game object in each Scene that you want audio in.
    •  
    • If you do need that, put a Master Audio game object with "persist across scenes" checked in your Bootstrapper Scene (a "loading" Scene that is never revisited after startup). Only put Sound Groups in the MA game object that you will need in every Scene as all Audio Clips in the game object will be constantly taking up audio memory (using Addressables, Resource Files or turning Preload Audio Data off will not though).
      •  
      • Tip: You can create all Playlists for all Scenes in this persistent MA game object if you are using all Addressables, Resource Files or turning Preload Audio Off for songs so no audio memory will be used except by songs that are playing at that time. If you are not using Addressables, Resource Files or turning Preload Audio Data off, this is a bad idea and you should use the Dynamic SGC to populate "temporary" Playlists in each Scene (more below).
      •  
      • Each other Scene will not need a Master Audio game object or Playlist Controller game object, because the MA and PC game objects from the Bootstrapper Scene will carry over when you play from the Bootstrapper Scene. However, for ease/speed of testing, you can (and should) add the same MA & PC game objects to each Scene that are in the Bootstrapper Scene, for use when you play that Scene directly. MA will automatically detect and delete the newer game objects upon loading the next Scene when a persistent MA game object is carrying over, so it's not a problem to keep copies of the game objects in every Scene.
      •  
      • Use one or more Dynamic Sound Group Creators in each subsequent Scene to temporarily populate the persistent MA game object with its contents until the Scene changes again. Dynamic SGC game objects dynamically fill and empty the MA game object with Sound Groups, Buses, Playlists and Custom Events. This helps a lot with memory management!
  4.  
  5. Make sure and read about more performance and memory concerns here.
 
Note: Resource Files have a hard limit of 4GB and if you go above that, you will need to use a different option. Addressables wraps up Resource Files and are our recommended option of the 3 except for the most often played sound effects.