Indigo Rose Software
  #1  
Old 09-26-2003
Desmond's Avatar
Desmond Desmond is offline
Indigo Rose Staff Member
 
Join Date: Jul 2003
Posts: 628
Grin Playing Multiple Audio Files in Sequence

Playing Multiple Video Files in Sequence

Playing Multiple Audio Files in Sequence

Document ID: IR10029
The 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:

  1. 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"

    };
  2. Insert the following code into the On Show event of your page:
    Audio.Load(CHANNEL_USER1, audio[audio_count], true, false);
  3. 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.
__________________
Setup Factory 8.0 comes with over 250 actions so you can create smaller, faster and more intelligent software installers than ever before.

WebHelp Guides: AMS | MSIFACT | SUF | TU | VP
  #2  
Old 08-13-2005
threaded threaded is offline
Forum Member
 
Join Date: Aug 2005
Posts: 17
Well, I started with this thread in how to create a pseudo playlist and have ams play it...I did some work on this and came up with a way to play audio in sequence and when it reaches the end, it loops back to the beginning. this is what I have..(maybe this will find its way into the help file as a better method??)

in global functions
Code:
-- keep track of the audio files
audio_count = 1;

--loads desired audio files into a table
audio = File.Find("Autoplay\\Audio\\", "??.ogg", false, true, nil, nil);
notice the stuff in File.Find...please change to suit your needs. All my audio is in Autoplay\Audio and is named numerically with only 2 numbers...01-14 for example.


in page on show
Code:
Audio.Load(CHANNEL_BACKGROUND, audio[audio_count], true, false);
in page on audio
Code:
if e_State == "Finish" then
    audio_count = audio_count + 1;
    --ensures a valid file will be loaded
    if audio_count < Table.Count(audio)+1 then
        Audio.Load(CHANNEL_BACKGROUND, audio[audio_count], true, false);
    else
        audio_count=1
        Audio.Load(CHANNEL_BACKGROUND, audio[audio_count], true, false);
    end
end

Last edited by threaded; 08-13-2005 at 06:17 AM.
  #3  
Old 08-14-2005
Intrigued's Avatar
Intrigued Intrigued is offline
Indigo Rose Customer
 
Join Date: Dec 2003
Location: Location! Location!
Posts: 6,059
In the last section... I do see a small area you can optimize (granted... it's not much to optimize) a tad.

Note: Take out what's in red and insert what is in green.

Code:
if e_State == "Finish" then
    audio_count = audio_count + 1;
    --ensures a valid file will be loaded
    if audio_count <= Table.Count(audio)+1 then
        Audio.Load(CHANNEL_BACKGROUND, audio[audio_count], true, false);
    else
        audio_count=1
        Audio.Load(CHANNEL_BACKGROUND, audio[audio_count], true, false);
    end
end
__________________
Intrigued
www.amsuser.com
  #4  
Old 08-15-2005
threaded threaded is offline
Forum Member
 
Join Date: Aug 2005
Posts: 17
couldnt it just be like this...I dunno and havent tested your observation or this...just in theory, this should be right...

Code:
    if audio_count = Table.Count(audio) then
  #5  
Old 08-15-2005
Intrigued's Avatar
Intrigued Intrigued is offline
Indigo Rose Customer
 
Join Date: Dec 2003
Location: Location! Location!
Posts: 6,059
Quote:
Originally Posted by threaded
couldnt it just be like this...I dunno and havent tested your observation or this...just in theory, this should be right...

Code:
    if audio_count = Table.Count(audio) then
I believe the best approach mixed in with good error checking... would be what I presented. But, that's my two cents worth.

__________________
Intrigued
www.amsuser.com
  #6  
Old 08-15-2005
threaded threaded is offline
Forum Member
 
Join Date: Aug 2005
Posts: 17
I dont know if you misunderstood what I typed or if I am misunderstanding you. I meant leave the rest of the code the same (I need the rest to get the final result I want) But in mathemtaical terms if this is true
1 < 1 + 1...then 1 = 1 is true also (this is derived from you comment to remove the +1 and add an =)
  #7  
Old 08-15-2005
Intrigued's Avatar
Intrigued Intrigued is offline
Indigo Rose Customer
 
Join Date: Dec 2003
Location: Location! Location!
Posts: 6,059
Here's a breakdown of what the operators mean and thus one can figure out the math end.

http://www.indigorose.com/webhelp/am..._Operators.htm

Specifically this line is the one to note for our conversation:

<= (less-than or equal to)
__________________
Intrigued
www.amsuser.com
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On


Similar Threads
Thread Thread Starter Forum Replies Last Post
rename multiple files jenny62 Setup Factory 6.0 1 04-13-2004 02:25 PM


All times are GMT -6. The time now is 04:29 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software