Audio.Load

Audio.Load ( 

number  Channel,

string  Filename,

boolean PlayAutomatic = false,

boolean Loop = false )

Example 1

Audio.Load(CHANNEL_BACKGROUND, "AutoPlay\\Audio\\Soothing Music 3.wav", true, true);

Loads the song "Soothing Music 3.wav" into the background audio channel, starts playing it automatically and tells it to loop back to the start at the end of the song.

Example 2

Audio.Load(CHANNEL_USER1, "AutoPlay\\Audio\\voiceover_012.ogg");

Loads an Ogg Vorbis audio file called "voiceover_012.ogg" into the first user channel.

Example 3

Audio.Load(CHANNEL_NARRATION, "http://www.indigorose.com/songs/myfile.ogg", true, true);
nError = Application.GetLastError();
if (nError~=0) then
    Dialog.Message("Error",_tblErrorMessages[nError]);
end

Loads an Ogg Vorbis audio file called "myfile.ogg" from a web address for streaming audio into the narration audio channel. The second line of code uses the Application.GetLastError action to see if the Audio.Load action failed. If it did (error code doesn't equal 0), a dialog message is displayed with the error message for that particular error code.

See also: Related Actions