Page 1 of 1

Audioclip loading is slow.

Posted: Thu May 21, 2020 5:15 am
by Developer36
Hi Moodkie Team,

I have been using esaysave for all saving related stuff in my game and its awesome to use. I have a scenario where the user adds a song in runtime from windows explorer and I save it to the disk with ES3.Save<AudioClip>() command. Next time when the user open the game the saved song will be loaded again that was saved previously. But I feel like the loading of the song takes more time.
Is there any workaround or advice to speed up the loading of the audioclip ? Will putting it in a different thread help to speed up loading?

Thank You!

Re: Audioclip loading is slow.

Posted: Thu May 21, 2020 6:21 am
by Joel
Hi there,

AudioClips are inherently large, so they're always going to have quite a large performance impact.

However, the first thing I would do is instead of loading the user's audio file and then using ES3.Save<AudioClip> to save it to disk, save their audio file directly using:

Code: Select all

ES3.SaveRaw(ES3.LoadRaw(PathToAudioFile), "MyAudioFile.wav");
You can then load this audio file using:

Code: Select all

var audioFile = ES3.LoadAudio("MyAudioFile.wav");
This ensures that the data remains in encoded format, and that it's decoded by the hardware where possible.

All the best,
Joel

Re: Audioclip loading is slow.

Posted: Thu May 21, 2020 8:07 am
by Developer36
Thank you so much for your quick response. :)
Using the process as you have mentioned solved the lag. Now the audio/song loading is instantaneous.