Stream Audio from a URL?
Now that GetAudioClip is obsolete in 5.6, how can I play music in my game from an external URL?
There's this... https://docs.unity3d.com/ScriptReference/WWWAudioExtensions.GetAudioClipCompressed.html
...but no examples of how to use it in script (C#)
I'm guessing this is some sort of WWW thing, but documentation is pretty much non-existent for 5.6
And please don't say "Asset Bundles", I've just killed 48 hours working on that
thanks
Answer by DAVcoHL · Jun 06, 2017 at 03:24 PM
I discovered this thread while looking for a way to stream audio from the web into a Unity app - I'm not sure if you're still working on this?
As I understand it, the WWW classes are deprecated. Any new code should be written using the UnityWebRequest API. Here are the docs for downloading an Audio Clip Networking.UnityWebRequest.GetAudioClip.
However I have yet to discover how to stream (rather than just download) an audio clip.
Hope that helps!
When you say WWW classes are deprecated, can you please point to where it has been written so? I am also trying to get audio strea$$anonymous$$g to work and using WWW right now to download data. However the documentation at https://docs.unity3d.com/ScriptReference/WWW.html does not say anywhere that the class is obsolete or deprecated.
Answer by vasupol11 · Sep 13, 2017 at 04:47 AM
I had the same question and I answered it here, the key is the progress at .01 (1%), time to wait until it starts streaming adjust it to .1 or higher for better results.
Answer by Mayank516 · May 14 at 01:38 AM
I have used below plugins for streaming audios on iOS and Android and they work out of the box. Developer is also very helpful. Provided support when ever was required.
Android : https://assetstore.unity.com/packages/tools/integration/audio-stream-in-android-196464
Your answer
Follow this Question
Related Questions
How can resolve URL with caracter like & and other ? 2 Answers
get image on url, replace and reload in runtime 1 Answer
WWW.GetAudioClip not working, throwing empty exception 2 Answers
Audio doesnt play in the phone but play on the editor 0 Answers
Can we stream audio from a URL instead of download and then play? 2 Answers