ES3.LoadAudio

public static AudioClip LoadAudio(string audioFilePath, ES3Settings settings)

Description

Loads an audio file as an AudioClip.

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.

Parameters

audiofilePath The relative or absolute path of the audio file we want to load.

settings

[Optional] The settings we want to use to override the default settings.

Returns

The loaded AudioClip.

Examples

C#

JS