
-----------------------------------
Stigmata
Tue May 30, 2006 10:09 pm

Playing Music; Intro and Looping Core Files
-----------------------------------
I've been trying to figure this out on my own for a few hours now, but I can't seem to make it work.  This is for a game, and I'm trying to get the game to play my Intro.wav file once, and immediately after play my Core.wav file in a loop.  So it goes Intro->Core->Core->Core etc.  The only thing is, I can't seem to make this work within a single fork statement, or using any combination of Music.PlayFile commands.
process music_level1
    Music.PlayFile ("level1_intro.wav")
    loop
        Music.PlayFileLoop ("level1_core.wav")
    end loop
end music_level1

fork music_level1

loop
end loop

Am I going in the right direction, or am I going to need to recode it?[/code]

-----------------------------------
LegendsEnd
Tue May 30, 2006 10:34 pm


-----------------------------------
Try:

process music_level1
    Music.PlayFile ("level1_intro.wav")
    loop
        Music.PlayFile ("level1_core.wav")
    end loop
end music_level1
fork music_level1

-----------------------------------
Stigmata
Tue May 30, 2006 10:42 pm


-----------------------------------
Thanks :D

I tried doing that before, but I think I closed the output window too soon, as there's apparently a huge amount of lag when switching between files to be played.  When I run that, and only that, my program plays the intro file, waits two seconds as the core file loads, plays the core file, waits two seconds as the core file apparently loads a second time, plays the core file, waits, etc.

Is there another way around this new issue?  I feel like such a noob :P

-----------------------------------
[Gandalf]
Tue May 30, 2006 10:50 pm


-----------------------------------
Music.PlayFileReturn ("level1_intro.wav")
Then, when it is detected that level1_into.wav has finished playing,
Music.PlayFileLoop ("level1_core.wav") 

-----------------------------------
MysticVegeta
Thu Jun 01, 2006 6:31 pm


-----------------------------------
yeah but note though: the above commands works with 4.05 or greater

-----------------------------------
Stigmata
Thu Jun 01, 2006 8:21 pm


-----------------------------------
Alright, I tried that, but there's a fairly huge delay between the end and beginning of the files being played.  Is there some way to load the sound files directly into memory, or does it always play them off the hard drive, resulting in the aforementioned lag?

-----------------------------------
Clayton
Thu Jun 01, 2006 9:49 pm


-----------------------------------
Turing plays songs from the hardrive, however, if you played the music from a cd you might get less lag. to play from a cd just use :

Music.PlayFile("cd")
%or if you want a specific track
Music.PlayFile("cd:trackToBePlayed")

:D

-----------------------------------
[Gandalf]
Fri Jun 02, 2006 11:34 pm


-----------------------------------
yeah but note though: the above commands works with 4.05 or greater
You do know this can be said for more than half the posts in the Turing section?  Cut the spam, comments like this aren't neccessary.

SuperFreak82, any file will load faster from your hard drive than from a CD, just think about it...  Really, you can't do anything about the loading delay, because the songs are loaded at run time.
