Computer Science Canada

using music in turing

Author:  SNIPERDUDE [ Thu Aug 03, 2006 3:25 pm ]
Post subject:  using music in turing

for the game i'm making, i want the music to repeat once it's done, but when I put it in a loop, Music.PlayFileStop doesn't work? how can I fix this?

Author:  maiku [ Thu Aug 03, 2006 4:25 pm ]
Post subject:  Music

If your coding is set up like this:
code:
loop
Music.PlayFile ("song.mp3")
end loop
% program here %
Music.PlayFileStop

then you need to change it to this:
code:
Music.PlayFileLoop ("song.mp3")
% program here %
Music.PlayFileSop

And if that doesnt work or you already have it like that, then I dont know

hope it helps

Author:  TokenHerbz [ Fri Aug 04, 2006 3:33 am ]
Post subject: 

well lets set up a proc for your music:

code:

var finish: boolean := false

process music_file
    loop
        exit when finish = true
        Music.PlayFile ("Music/intro_music.MP3")
    end loop
end music_file


O yeah, i like to do more then i need Smile anyways onward..

Now you have your loop
code:

loop

     %%call you music file to play
     fork music_file

    %%when you want it killed
    finish := true
    Music.PlayFileStop      %%stops intro music!
end loop


i think some uneeded code in there but o well... it should work..

In order to prevent your song from starting over eventime the loop restarts, have it in an if statment to which it will call the music proc when the songs done SmileSmileSmile late late, but work aroung with the code, experiment...

****Note:::: I didnt test anything i posted so nothing may work Very Happy

Author:  Clayton [ Fri Aug 04, 2006 8:59 am ]
Post subject: 

maiku's second bit of code is probably the best thing that you can use, if you dont know exactly what Music.PlayFileLoop does, here it is:
Music.PlayFileLoop is basically a procedure in the Music module that more or less calls a process within it as well over and over again until a call to Music.PlayFileStop has been made

Author:  TokenHerbz [ Fri Aug 04, 2006 12:01 pm ]
Post subject: 

its goot for a long for loop though... say in an intro where you peresent words and things...


: