- Home /
Unity download audio
Hi! I have a project where I need to download and store audio file from a website. I have tried it using .mp3, but as it turned out, it doesn't work on webplayer (the project is developed for android and webplayer). I have found a similar post here, which adived to use .ogg, but it didn't work either. Ogg streaming was not supported (I have tried it on the android version). The only format I could use on both versions was the .wav, but it is extremely big, around 10 times bigger than .ogg. Do you have any suggestions what I could do?
Answer by 265lutab · May 21, 2016 at 05:38 AM
You could have a .mp3 and an .ogg (which should be supported by the web player) and then use
#if UNITY_ANDROID
#elseif UNITY_WEBPLAYER
#endif
and put the url for the .mp3 in android and the .ogg in webplayer
http://docs.unity3d.com/Manual/PlatformDependentCompilation.html
Your answer
Follow this Question
Related Questions
Is WWW class usable in Android platform? 1 Answer
WWW class streaming high RAM usage 0 Answers
How to have www streaming to work with a radio station? 1 Answer
WWW.audioClip not playing on android build 1 Answer
Endless Audio streaming (Radio)?! 3 Answers