Troubleshooting and Diagnostics
Besides the Unity Profiler, there are several features included in Master Audio to help you diagnose and troubleshoot audio issues at runtime.
- Logging: turn on "Log Sounds" in Advanced Settings to log things to the Console when sound effects are told to play. It will tell you which Sound Groups are being triggered, and which are not playing for various reasons (bus voice limit reached, all Variations busy, etc). You can turn this on for all Sound Groups in Advanced Settings, or turn it on for individual Sound Groups on the Sound Group's Inspector. The full decision tree executed by Master Audio when a Sound Group is requested to play is shown in the image at the bottom of this page.
-
Active Voice Counts: The Group Mixer shows Active Voice Counts to the left of each Sound Group. This will tell you how many are playing at any given time. You can also click the number and it will select all the active Variations in the Hierarchy. Red indicates that all Variations are busy. Buses show the same info for the bus, with red indicating that the Bus voice limit has been reached.
-
Variation Status: If you look at a Sound Group's Inspector (or a Variation's), it will show the status of the Variation (not playing / paused / playing) and the percentage played as well. There's also a "Select Caller" button if the Variation is associated with a Transform (which is always recommended so you can figure out what Game Object is making the sound). Clicking "Select Caller" will take you to the Game Object, where there's more diagnostic helpers called the Audio Transform Tracker (next section).
-
Audio Transform Tracker: Any Game Object in your Hierarchy that is playing 1 or more sounds has an Audio Transform Tracker in the Inspector. This offers many ways to visualize what's going on and manipulate things. Here you can see all the sounds being played (or paused) by the Game Object, and can pause / unpause / stop any or all of them, as well as go to the Sound Group and Variation's Inspectors. Note that this script only appears during runtime.
- Occlusion: If you are using Occlusion, and things aren't sounding the way you think they should, make sure to turn on "Show Ray Casts" so you can visibly see in Scene View what is blocking the Ray Cast. You can then adjust the Ray Cast Origin Offset for the Sound Group (or all of them with the global setting), change the layer / layer mask etc. Occlusion also has more diagnostics if you turn on the "Show Diagnostic Buckets" checkbox as well. Read more on the Occlusion page.
- Ambient Sound: If the Ambient Sound script doesn't seem to work at all, check the Layer Collision Matrix and make sure that Ignore Raycast layer can collide with itself. That is required for Ambient Sound to work properly.
- Audio Listener: The Audio Listener in the Scene is important. It is used by Ambient Sound script & Occlusion. If you change Audio Listeners while in the same Scene (disable one Listener and enable another), you will need to let Master Audio know so those features will continue to work. Use this code to do so:
MasterAudio.AudioListenerChanged(newListenerComponent);
- Long-Standine Unity Bugs: If you notice that your music doesn't play or your app can't be closed when built to PC Standalone platform, this can be caused by any Audio Clip that you're using having the combination of both "Load In Background" and "Compressed In Memory". So check for that combo with Bulk Audio Importer and change one or the other. This bug happens even without Master Audio installed in your project. We have reported this bug so hopefully Unity fixes it soon.
- The Master Audio "Play Sound Group" Decision Tree:
-
Note: If you are in need of more diagnostics, please notify us and we will add to this page and/or add features. Email us at support@darktonic.com or post on the official support forum.