Search Unity

  1. All Pro and Enterprise subscribers: find helpful & inspiring creative, tech, and business know-how in the new Unity Success Hub. Sign in to stay up to date.
    Dismiss Notice
  2. Dismiss Notice

Getting Volume Independent Audio Data

Discussion in 'Audio & Video' started by Picky-Salamander, Oct 7, 2015.

  1. Picky-Salamander


    Apr 26, 2013
    Disclaimer: I know next to nothing about how audio works in Unity.

    We currently use AudioSource.GetSpectrumData to get data for lip-sync in our game. It's been working fine up until now, but we want to allow the users to alter the volume of the game. When doing this, the values from AudioSource.GetSpectrumData decrease with the level of the volume and for that matter, when the AudioListener moves away from the source. So if the user had the game muted, none of the characters would move their mouths.

    I tried to fix the problem by using AudioClip.GetData, before it went to the source and was played. Unfortunately, this doesn't work, because all our audio is loaded through bundles with CompressedInMemory. I'm afraid to turn all my audio to DecompressOnLoad, because we have a large amount of audio loaded once the game starts up.

    Is there a way to do this? Am I on the right track here?