0
\$\begingroup\$

I am developing a game in Unity3d 2019, the instructions of the game must be translated into several languages. Right now, they are part of the compilation, but this makes the compilation very large.

I would like, according to the selected language, to be able to download the corresponding audio and save it in the cache.

\$\endgroup\$
  • 1
    \$\begingroup\$ What have you tried? Have you searched about downloading assets using Unity? That way you can use them the same way as local assets. \$\endgroup\$ – TomTsagk Sep 2 '19 at 18:30
  • \$\begingroup\$ Hello @TomTsagk. The resources that I use are the ones that I have in the project, I need to be able to download the audio resources remotely and that they are stored in the device so as not to have to download them again, but I have not found documentation on this. \$\endgroup\$ – Jaime Roman Sep 2 '19 at 18:38
  • \$\begingroup\$ I just searched for "Unity download remote file" and got plenty of promising results. Did any of them work for you? \$\endgroup\$ – TomTsagk Sep 3 '19 at 9:03
0
\$\begingroup\$

https://docs.unity3d.com/ScriptReference/WWW-audioClip.html https://forum.unity.com/threads/download-and-save-www-mp3-file.409470/

these are what you are looking for. but WWW is being deprecated. just try to find UnityHttpRequest replacement solution for this. in these threads you problem is dicussed well.

you can check if you have that file in your device. if there isnt, so you have to get it from server.

| improve this answer | |
\$\endgroup\$
  • 1
    \$\begingroup\$ This answer would benefit from a working example or walkthrough of the process to create one, rather than just links to the component parts. \$\endgroup\$ – DMGregory Sep 2 '19 at 20:32
  • 1
    \$\begingroup\$ I would recommend using an AssetBundle instead of downloading individual audio clips, partly because Unity has AssetBundle caching built in. \$\endgroup\$ – Ed Marty Sep 3 '19 at 12:27
  • \$\begingroup\$ @EdMarty yes. good suggestion. you can update the answer if you want. \$\endgroup\$ – virtouso Sep 3 '19 at 12:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.