|
Post by dreasgrech on Mar 15, 2016 3:21:03 GMT
Using MasterAudio, how can I download an mp3 and play it in-game?
|
|
|
Post by DarkTonic Dev on Mar 15, 2016 4:09:50 GMT
Only possible with the sound effect unit (Sound Group) and not in Playlists. Go to one of your Variations in a Sound Group (it can be the only Variation), and set Audio Origin to "File On Internet". Then enter the URL. When you press play, watch the Master Audio mixer section. The row for that Sound Group has a loading indicator that will show when the mp3 is downloading, ready to play or fails download. Read more here: dl.dropboxusercontent.com/u/40293802/DarkTonic/MA_OnlineDocs/SoundGroupVariations.htmAt the point, you can play it like any sound effect: MasterAudio.PlaySoundAndForget("DownloadedMusic");
Or any of the other methods that start with "PlaySound".
|
|
|
Post by dreasgrech on Mar 15, 2016 17:28:46 GMT
Thanks for your reply.
Is there any way I can do this programmatically i.e. specifying an MP3 url while the game is running so that it's downloaded and played?
The reason I ask is because I noticed that MasterAudio downloads the files during Awake.
|
|
|
Post by DarkTonic Dev on Mar 15, 2016 17:57:01 GMT
Yes, but you will have to do the same thing I suggested in a DynamicSoundGroupCreator prefab. Then spawn or Instantiate it and it will start downloading at that moment.
This doesn't involve any coding unless you use code to Instantiate / spawn it.
You still will have to set the Url in advance, not through code.
|
|