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

Username:   Password: 
 RegisterRegister   
 Adding Background Music
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
kokolovehuh




PostPosted: Mon May 26, 2008 7:53 pm   Post subject: Adding Background Music

I have had a trouble recently in putting the background into my program, the file type is mp3/wav.
What I want to do is basically NOT to make the music like a block, which means the rest of the program runs after all the music,
and eventually the music is playing but the program is still running, kind of like a background

Can anybody help me out, please? Idea
Sponsor
Sponsor
Sponsor
sponsor
Hendo




PostPosted: Mon May 26, 2008 8:23 pm   Post subject: RE:Adding Background Music

i havent done turing in a while but what you would want to do is make a process

so something like

code:
process bgmusic
%code to play music here
end bgmusic


and then you play your music by calling your process:
code:
fork bgmusic


my turing is really rusty so someone might have to clean that up
Insectoid




PostPosted: Mon May 26, 2008 8:31 pm   Post subject: RE:Adding Background Music

code:

process playmusic
     Music.Playfile ("song.mp3")
end playmusic
fork playmusic


don't use a wav file, they can't 'fork'. Only 1 wav can be played at a time i.e. calling another wav will cancel out your background.
Hendo




PostPosted: Mon May 26, 2008 8:35 pm   Post subject: RE:Adding Background Music

yeah use mp3's for music and wavs for sound effects
kokolovehuh




PostPosted: Mon May 26, 2008 9:49 pm   Post subject: Re: RE:Adding Background Music

insectoid @ Mon May 26, 2008 8:31 pm wrote:
code:

process playmusic
     Music.Playfile ("song.mp3")
end playmusic
fork playmusic


don't use a wav file, they can't 'fork'. Only 1 wav can be played at a time i.e. calling another wav will cancel out your background.


ok, but then there is an error at the line "Music.Playfile ("song.mp3")"

it says: 'Playfile is not in the export list of 'Music'
CodeMonkey2000




PostPosted: Mon May 26, 2008 10:00 pm   Post subject: RE:Adding Background Music

It's Music.PlayFile ("song.mp3") . F is capital.
Insectoid




PostPosted: Tue May 27, 2008 9:19 am   Post subject: RE:Adding Background Music

Oops...

The trick to making these things work is to swith out capitals until the word turns from blue to black.
Sean




PostPosted: Tue May 27, 2008 12:03 pm   Post subject: Re: Adding Background Music

Or, if you can't seem to get it right. F10 it and search for it. You'll surely get it done faster that way then by capitalizing random letters. Twisted Evil
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: