Desmond
09-26-2003, 01:14 PM
<HTML> <HEAD> <TITLE>Playing Multiple Video Files in Sequence</TITLE> </HEAD> <BODY> <h3>Playing Multiple Audio Files in Sequence</h3> <b>Document ID: IR10029</b> <hr> The information in this article applies to: <ul> <li>AutoPlay Media Studio 5.0 Standard Edition</li> <li>AutoPlay Media Studio 5.0 Professional Edition</li> </ul> <hr> <h3>SUMMARY</h3> <p>This article describes how to play multiple video files in sequence. </p> <h3>DISCUSSION</h3> <p>In AutoPlay Media Studio 5.0, it is possible to play one audio file after another using the On Audio event.<br> <br> 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.<br> <br> To accomplish this:</p> <ol> <li>Insert the following code into your Global Functions (click Project, click Global Functions):<code><pre>-- keep track of the audio files
<br />audio_count = 1;
<br />--load desired audio files into a table
<br />audio = {
<br /> "Autoplay\\Audio\\audio_file1.ogg",
<br /> "Autoplay\\Audio\\audio_file2.ogg",
<br /> "Autoplay\\Audio\\audio_file3.ogg"
<br />}; </pre></code> </li> <li>Insert the following code into the On Show event of your page:<code><pre>Audio.Load(CHANNEL_USER1, audio[audio_count], true, false);</pre></code></li><li>Insert the following code into the On Audio event of your page:<code><pre>if e_State == "Finish" then
<br /> audio_count = audio_count + 1;
<br /> --ensure a valid file will be loaded
<br /> if audio_count < Table.Count(audio)+1 then
<br /> Audio.Load(CHANNEL_USER1, audio[audio_count], true, false);
<br /> end
<br />end</pre></code></li> </ol> <h3>MORE INFORMATION</h3> <p>For more information please see the following topics in the AutoPlay Media Studio 5.0 help file:</p> <ul> <li><b>Program Reference | Actions | Audio | Audio.Load</b></li> </ul> <p>KEYWORDS: AutoPlay Media Studio 5.0, Load, Audio, Sound, Play, Multiple Files </p> <hr> <FONT SIZE=1> Last reviewed: September 26, 2003<br> Copyright © 2003 <A HREF="http://www.indigorose.com" target="blank">Indigo Rose Corporation</a>. All rights reserved.<br> </FONT> </BODY> </HTML>
<br />audio_count = 1;
<br />--load desired audio files into a table
<br />audio = {
<br /> "Autoplay\\Audio\\audio_file1.ogg",
<br /> "Autoplay\\Audio\\audio_file2.ogg",
<br /> "Autoplay\\Audio\\audio_file3.ogg"
<br />}; </pre></code> </li> <li>Insert the following code into the On Show event of your page:<code><pre>Audio.Load(CHANNEL_USER1, audio[audio_count], true, false);</pre></code></li><li>Insert the following code into the On Audio event of your page:<code><pre>if e_State == "Finish" then
<br /> audio_count = audio_count + 1;
<br /> --ensure a valid file will be loaded
<br /> if audio_count < Table.Count(audio)+1 then
<br /> Audio.Load(CHANNEL_USER1, audio[audio_count], true, false);
<br /> end
<br />end</pre></code></li> </ol> <h3>MORE INFORMATION</h3> <p>For more information please see the following topics in the AutoPlay Media Studio 5.0 help file:</p> <ul> <li><b>Program Reference | Actions | Audio | Audio.Load</b></li> </ul> <p>KEYWORDS: AutoPlay Media Studio 5.0, Load, Audio, Sound, Play, Multiple Files </p> <hr> <FONT SIZE=1> Last reviewed: September 26, 2003<br> Copyright © 2003 <A HREF="http://www.indigorose.com" target="blank">Indigo Rose Corporation</a>. All rights reserved.<br> </FONT> </BODY> </HTML>