Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Playing Music; Intro and Looping Core Files
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Stigmata




PostPosted: Tue May 30, 2006 10:09 pm   Post subject: 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.
code:
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]
Sponsor
Sponsor
Sponsor
sponsor
LegendsEnd




PostPosted: Tue May 30, 2006 10:34 pm   Post subject: (No subject)

Try:

code:
process music_level1
    Music.PlayFile ("level1_intro.wav")
    loop
        Music.PlayFile ("level1_core.wav")
    end loop
end music_level1
fork music_level1
Stigmata




PostPosted: Tue May 30, 2006 10:42 pm   Post subject: (No subject)

Thanks Very Happy

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 Razz
[Gandalf]




PostPosted: Tue May 30, 2006 10:50 pm   Post subject: (No subject)

code:
Music.PlayFileReturn ("level1_intro.wav")

Then, when it is detected that level1_into.wav has finished playing,
code:
Music.PlayFileLoop ("level1_core.wav")
MysticVegeta




PostPosted: Thu Jun 01, 2006 6:31 pm   Post subject: (No subject)

yeah but note though: the above commands works with 4.05 or greater
Stigmata




PostPosted: Thu Jun 01, 2006 8:21 pm   Post subject: (No subject)

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




PostPosted: Thu Jun 01, 2006 9:49 pm   Post subject: (No subject)

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 :
code:

Music.PlayFile("cd")
%or if you want a specific track
Music.PlayFile("cd:trackToBePlayed")

Very Happy
[Gandalf]




PostPosted: Fri Jun 02, 2006 11:34 pm   Post subject: (No subject)

MysticVegeta wrote:
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.
Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 8 Posts ]
Jump to:   


Style:  
Search: