Playing Multiple Audio Files in Sequence
Document ID: IR10029The information in this article applies to:
- AutoPlay Media Studio 5.0 Standard Edition
- AutoPlay Media Studio 5.0 Professional Edition
SUMMARY
This article describes how to play multiple video files in sequence.
DISCUSSION
In AutoPlay Media Studio 5.0, it is possible to play one audio file after another using the On Audio event.
As an example, we will create a project that when run will load three files into a table, and play them back-to-back until the third song is finished.
To accomplish this:
- Insert the following code into your Global Functions (click Project, click Global Functions):
-- keep track of the audio files
audio_count = 1;
--load desired audio files into a table
audio = {
"Autoplay\\Audio\\audio_file1.ogg",
"Autoplay\\Audio\\audio_file2.ogg",
"Autoplay\\Audio\\audio_file3.ogg"
}; - Insert the following code into the On Show event of your page:
Audio.Load(CHANNEL_USER1, audio[audio_count], true, false);
- Insert the following code into the On Audio event of your page:
if e_State == "Finish" then
audio_count = audio_count + 1;
--ensure a valid file will be loaded
if audio_count < Table.Count(audio)+1 then
Audio.Load(CHANNEL_USER1, audio[audio_count], true, false);
end
end
MORE INFORMATION
For more information please see the following topics in the AutoPlay Media Studio 5.0 help file:
- Program Reference | Actions | Audio | Audio.Load
KEYWORDS: AutoPlay Media Studio 5.0, Load, Audio, Sound, Play, Multiple Files
Last reviewed: September 26, 2003
Copyright © 2003 Indigo Rose Corporation. All rights reserved.
Comment