Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 5 of 5

Thread: Play Music

  1. #1
    Join Date
    Jun 2004
    Posts
    19

    Play Music

    Hi,

    i'm working with 4.0 and i need to play different music for different sections of my program.

    More specifically,
    There are many sections; each containing Random Page Jumps within that section
    A1 - A10
    B1 - B10
    C1 - C10

    i would like to have one song play continuously as long as you are Page Jumping A1 - A10
    but when you go to B1 - B10, i want a different song to play continuously while Page Jumping in that section. and the same for section C1 - C10.

    Please, help
    Thanx

  2. #2
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    Try this. I found some old code that I modified to hopefully work in your project.

    Put the code in as follows

    Code:
    --place in the [On Initialize] event for pages A
    IF ( !%avisit%)
    MP3.Load ("%SrcDir%\MyMP3\SongA.mp3")
    MP3.Play
    MP3.SetRepeat (TRUE)
    %avisit% = Evaluate (TRUE)
    %bvisit% = Evaluate (FALSE)
    %cvisit% = Evaluate (FALSE)
    END IF
    --place in the [On Initialize] event for pages b
    IF ( !%bvisit%)
    MP3.Load ("%SrcDir%\MyMP3\SongB.mp3")
    MP3.Play
    MP3.SetRepeat (TRUE)
    %avisit% = Evaluate (FALSE)
    %bvisit% = Evaluate (TRUE)
    %cvisit% = Evaluate (FALSE)
    END IF
    --place in the [On Initialize] event for pages C
    IF ( !%cvisit%)
    MP3.Load ("%SrcDir%\MyMP3\SongC.mp3")
    MP3.Play
    MP3.SetRepeat (TRUE)
    %avisit% = Evaluate (FALSE)
    %bvisit% = Evaluate (FALSE)
    %cvisit% = Evaluate (TRUE)
    END IF
    What should happen is this, When you first load an A page it will evaluate the %avisit% to false by default and load and play the song. It then sets the other %bvisit% and %cvisit% values to false as well, but the %avisit% it sets to true so it doesn't reload the song. Then when you go to a B or C page it then loads the appropriate song and sets the other variables to false.

    I can't guarantee that it will work as I haven't done much with AMS 4 code in a looooong time.

    Tigg
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

  3. #3
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    You could probably go one step further and make it so that when the song stops, you record the %aposition% of where the song stopped. Then when your reload the song, you could use the MP3.SEEK and seek to that spot.

    Tigg
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

  4. #4
    Join Date
    Jun 2004
    Posts
    19
    Thanx

    i'll try it tonite and let u know how it turns out

    Thanx Again

  5. #5
    Join Date
    Jun 2004
    Posts
    19

    RE: Play Music

    Hey, Tigg

    I tried the code you shared! It worked perfectly.
    You suggested the ability to record the position of the song and do a MP3 seek.

    What is the code that would make this possible and should it be placed right after the
    End If line?

    Thanx for your help; you're a genius!

Similar Threads

  1. Randomize play list
    By markstaylor in forum AutoPlay Media Studio 5.0
    Replies: 10
    Last Post: 08-04-2004, 11:04 PM
  2. About background music of pause and play?
    By pierre in forum AutoPlay Media Studio 5.0
    Replies: 0
    Last Post: 04-26-2004, 04:51 AM
  3. Playing Background Music
    By Desmond in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 09-26-2003, 12:25 PM
  4. Toggling the Background Music On and Off
    By Desmond in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 09-22-2003, 02:59 PM
  5. how do I group single mp3's to play non stop?
    By georallim in forum AutoPlay Media Studio 4.0
    Replies: 2
    Last Post: 06-17-2003, 08:51 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts