
-----------------------------------
SNIPERDUDE
Thu Aug 03, 2006 3:25 pm

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?

-----------------------------------
maiku
Thu Aug 03, 2006 4:25 pm

Music
-----------------------------------
If your coding is set up like this:
loop
Music.PlayFile ("song.mp3")
end loop
% program here %
Music.PlayFileStop
then you need to change it to this:
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

-----------------------------------
TokenHerbz
Fri Aug 04, 2006 3:33 am


-----------------------------------
well lets set up a proc for your music:


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 :)  anyways onward..

Now you have your loop

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 :):):)       late late, but work aroung with the code, experiment...

****Note::::   I didnt test anything i posted so nothing may work :D

-----------------------------------
Clayton
Fri Aug 04, 2006 8:59 am


-----------------------------------
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

-----------------------------------
TokenHerbz
Fri Aug 04, 2006 12:01 pm


-----------------------------------
its goot for a long for loop though...  say in an intro where you peresent words and things...
