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.
-
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.
-
Audio Clip: Here you assign the Audio Clip of the Variation by dragging and dropping here.
-
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:
- Install the "Addressables" package from Package Manager.
- Turn on "Addressables" checkbox from the Master Audio Welcome Window. This will cause a recompile.