Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Compressing AudioClip data at runtime? WWW.GetAudioClipCompressed not working as intended.

Discussion in 'Audio & Video' started by L-W, Mar 9, 2015.

  1. L-W


    Mar 3, 2013
    Hello! I've been loading Audio via .ogg files at runtime with the WWW class and whenever I use WWW.GetAudioClip to construct an AudioClip from the file, it decodes or uncompresses the data (compressed 1.6mb file ending up 30mb or so).

    From what I've read, using WWW.GetAudioClipCompressed "returns an AudioClip generated from the downloaded data that is compressed in memory" which is exactly what I want as "by default GetAudioClip will load the file into memory decompressed." It claims to "load the data compressed and decompress it as it plays" which is, if I understand correctly, exactly what Unity does when it plays compressed audio imported before runtime.

    Is there a reason why WWW.GetAudioClipCompressed loads the RAM with exactly the same amount of MB as WWW.GetAudioClip? This seems like a bug to me but I could be wrong, does anyone have any idea what could be going wrong?

    Thanks in advance for any assistance!