With the deprecation of *WWW.GetAudioClip*, *UnityWebRequestMultimedia.GetAudioClip* seems to be the main way to download custom audio off the internet and play it at runtime. Which is great and all, but what about loading custom audio off the player's hard drive?
Surely there must be some synchronous method for creating an AudioClip using a file off the hard disc; something that doesn't require messing around with web code and coroutines. Is there some way to--for instance--use *File.ReadAllBytes()* at runtime and pass the resulting byte array into an *AudioClip*? (I notice that *[AudioClip.SetData()][1]* expects to receive a float[], which is decidedly not a byte array, and that the *[AudioClip.LoadAudioData()][2]* method seems to...be useless?)
Is *UnityWebRequestMultimedia.GetAudioClip()* really the only game in town? Or is there something a little less cumbersome available for loading custom audio off the hard drive?
[1]: https://docs.unity3d.com/ScriptReference/AudioClip.SetData.html
[2]: https://docs.unity3d.com/ScriptReference/AudioClip.LoadAudioData.html
↧