Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

What's the replacement for WWW.audioClip?

Discussion in 'Scripting' started by JoeStrout, Jun 15, 2017.

  1. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    8,747
    According to the docs, WWW.audioClip is obsolete and removed in 5.6.1p1.

    So what's the replacement? How do I create an AudioClip from an Ogg, MP3, WAV, XM, IT, MOD or S3M file now?

    (My real goal is simply to load sounds from WAV files at runtime, and not to sink a bunch of time into writing my own WAV parser. So if there is no drop-in replacement for WWW.audioClip, then pointers to scripts online or low-cost assets that get the job done would also be appreciated.)

    Thanks,
    - Joe
     
  2. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    7,626
    Ryiah and JoeStrout like this.
  3. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    8,747
    Oh yeah. Duh. :) I knew that but for some reason it didn't come to mind this morning.

    For posterity, the (more or less) direct equivalent of WWW.audioClip would be UnityWebRequest.GetAudioClip.

    Awesome. Thanks for the quick response!
     
  4. justdizzy

    justdizzy

    Joined:
    Mar 8, 2016
    Posts:
    63
  5. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    8,747
    (To be clear, I like that you pointed it out... I don't much like the ever-changing-for-no-good-reason API. ;) )
     
    justdizzy likes this.
unityunity