Audio Origin

The "Audio Origin" field appears in many Inspectors in Master Audio. It refers to where the Audio Clip is located and how / whether it needs to be "loaded" before it can play. Here it is shown in the Variation Inspector. It also appears in Playlist Settings.

 
There are 3 choices:

     
  • Clip: The default. Just drag any Audio Clip from Project window into the Inspector. This Audio Origin will always occupy audio memory even when it's not being played, unless you uncheck the "Preload Audio Data" checkbox on the Audio Clip's import settings. The following additional fields appear for Audio Origin of Clip:
     
       
    • Audio Clip: Here you assign the Audio Clip of the Variation by dragging and dropping here.
       
      Note: You can make a "Silence" Variation by not assigning an Audio Clip. This can be used for a "25% chance to play" Sound Group by using a silence Variation with Voices = 3 and another Variation with Voices = 1 that has an Audio Clip. Silence Variations do not take up voices on the mixer / Group / Bus, but they do still show LED's on the Group Mixer when triggered.
  •  
  • Resource File: This option uses Unity Resource Files. To use this option, you must place the Audio Clip somewhere under a folder called "Resources", which can be located anywhere. You can save on memory usage with this option, although using "Clip" and unchecking Preload Audio Data on the Audio Clip does approximately the same thing if you don't need Localization. Audio Clips from Resource fields are loaded when told to Play, simultaneously into all Variations referencing that Clip, which causes a brief latency in most cases (the load). Whenever one finishes playing or stops for another reason and zero of the clip are playing, the clip is unloaded from memory. This is now a "legacy" option because Resource Files can now be marked as Addressables (see "Addressable" Audio Origin below). The following additional fields appear for Audio Origin of Resource File:
     
       
    • Yellow Drag Area: Drag an Audio Clip here from a Resource folder to populate the Resource filename field. If you drag from a top-level folder with a Language name (such as Resources/Chinese), the Use Localized Folder checkbox will be checked for you. You can click the lock icon at the very top right of the Inspector to enable selection of multiple clips from Project View without losing focus on the Inspector so you can drag in several at once.
    •  
    • Resource filename: Do not put the file extension here (i.e. for King.mp3 enter "King"). You can also drag the file from a Resource folder into the drag area above this. It will populate the folder and filename automatically.
    •  
    • Use Localizer Folder: When this is checked, this Variation is now considered localized and Master Audio will attempt to play the correct language Audio Clip when you preview or play that Variation at runtime. If you are missing an audio file for that language, an error will be logged to let you know. For example, if you forgot to make Resources/French/Hello.wav and played the Hello sound using the French language, you would get an error.
  •  
  • Addressable: This option is not available until you do both of the following:
       
    1. Install the "Addressables" package from Package Manager.
    2.  
    3. Turn on "Addressables" checkbox from the Master Audio Welcome Window. This will cause a recompile.
     
     
    To use the Addressable option, you must mark the Audio Clip as Addressable. There is a checkbox for this on the Audio Clip's import settings for this purpose. There are more steps to using Addressables, and I recommend following some tutorials online. This Audio Origin will only occupy audio memory while it's being played. When Master Audio is told to play a sound that is an Addressable, it will first load it into memory, which may cause a brief latency. Resource Files can be marked as Addressable, and Master Audio will download anything it needs when a sound is requested to play. However, to avoid any large latency, it is recommended to download any bundles containing audio (with your own code) prior to telling Master Audio to play an Addressable sound, so that the bundle is already present on the device.