Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Dynamically unloading a sound that hasn't finished loading yet. What?

Discussion in 'Audio & Video' started by jerotas, Mar 12, 2016.

  1. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,555
    One of our users (of Master Audio) reported the following warning. How / when is this logged so we can figure out how to avoid the circumstances that log it?

    "Dynamically unloading a sound that hasn't finished loading yet. If you see this message a lot, some scripts may be doing too many dynamic load/unload operations which will negatively affect performance."

    Note that they have turned on "load in background" for the audio clip and turned off "preload audio data".
     
  2. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,555
    Bump. Probably only a Unity dev knows the answer....
     
  3. doggan

    doggan

    Joined:
    Aug 12, 2012
    Posts:
    23
    I saw this warning when I tried to unload an asset bundle, which had an attached AudioClip with "Load in Background" enabled. It looks like possibly the asset bundle was unloaded before the AudioClip finished loading, so attempting to play back the AudioClip results in no sound. Then when going from Play mode to Editor mode, this warning appears in the console.
     
  4. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,555
    Thanks, I'll try to handle that.