Saving and loading images and audio

Saving a Texture2D as an image

You can save a Texture2D as a JPG or a PNG using ES3.SaveImage.

Loading an image as a Texture2D

You can load a JPG or PNG as a Texture2D using ES3.LoadImage.

A byte array containing the image data can also be provided as a parameter to this method.

Loading an image from a path

Load image from byte array

Loading audio files

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

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

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

WAVXMITMOD and S3M files are supported on all platforms.

Saving audio files

It’s not possible to save an AudioClip 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.

You can also save the original audio file if you have access to it: