Computer Science Canada

Music.Playfile Trouble While Running The Program.

Author:  Gackt [ Thu Dec 20, 2007 5:15 pm ]
Post subject:  Music.Playfile Trouble While Running The Program.

Ok, I'm having trouble playing My Music.Playfile while executing the program, ike the music plays but Nothing else will work, Is this because I only put in the Music.Playfile or something else? I;m not really sure how to fix this, it kinda stumped me, I looked at the tutorial that Dan posted but i Didnt really understand it. Thanks for your help.

Author:  Clayton [ Thu Dec 20, 2007 5:18 pm ]
Post subject:  RE:Music.Playfile Trouble While Running The Program.

It's working exactly as you coded it to. When you run Music.PlayFile(), the program will wait for the music to finish before continuing on. Look into Music.PlayFileReturn() instead.

Author:  HeavenAgain [ Thu Dec 20, 2007 5:19 pm ]
Post subject:  RE:Music.Playfile Trouble While Running The Program.

what alot of people do is process for background music, something like
code:
process bgmusic
loop
MusicPlayfile
end loop
end bgmusic
fork bgmusic

somewhat like that so it continues playing
so just fork it Rolling Eyes

Author:  Gackt [ Thu Dec 20, 2007 5:47 pm ]
Post subject:  RE:Music.Playfile Trouble While Running The Program.

Eh, Your Right, Thanks for your help, I got it working now.

Author:  questionableninja [ Thu Jan 03, 2008 7:09 pm ]
Post subject:  Re: RE:Music.Playfile Trouble While Running The Program.

HeavenAgain @ Thu Dec 20, 2007 5:19 pm wrote:
what alot of people do is process for background music, something like
code:
process bgmusic
loop
MusicPlayfile
end loop
end bgmusic
fork bgmusic

somewhat like that so it continues playing
so just fork it Rolling Eyes


yea i know this isn't my question but when i try to fork som music it works fine but i can't end the program even when the game is done Shocked

Author:  HeavenAgain [ Thu Jan 03, 2008 7:28 pm ]
Post subject:  RE:Music.Playfile Trouble While Running The Program.

simple, just add a boolean to keep track whenever you want to exit the music, say you have a boolean variable called flag and its false, now in your process bgmusic you just add "exit when flag", and make the flag true whenever you want to stop it Smile

Author:  questionableninja [ Sat Jan 05, 2008 1:36 am ]
Post subject:  Re: Music.Playfile Trouble While Running The Program.

thx man

Author:  ericfourfour [ Sat Jan 05, 2008 9:03 pm ]
Post subject:  Re: Music.Playfile Trouble While Running The Program.

For the sake of simplicity.

Play music: Music.PlayFileReturn("music_file_name")

Stop music: Music.PlayFileStop

From the Turing Documentation under the Music module.


: