Saving and Loading Audio

Loading Audio Files

You can load audio files as an AudioClip using the ES3.LoadAudio method.

MP3 files are only supported on mobile, and Ogg Vorbis files are only supported on standalone platforms.

WAV, XM, IT, MOD and S3M files are supported on all platforms except WebGL.

As this method requires file access, this method is not supported on WebGL.

A FileNotFoundException will be thrown if the file does not exist. In this case, you can use ES3.FileExists to check if the data exists before loading.

C#

JS

Saving Audio Files

It’s not currently possible to save audio to a compressed format as Unity lacks the required encoders to do so.

However, it’s possible to save and load an AudioClip in Easy Save’s format using the normal ES3.Save and ES3.Load methods. As the data is uncompressed, the file size will be larger than compressed formats.

C#

JS