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

Username:   Password: 
 RegisterRegister   
 How do I play sound without stalling?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
fear01




PostPosted: Wed Nov 23, 2005 10:14 pm   Post subject: How do I play sound without stalling?

It's the newbie again, I was wondering if anyone could help me with the sound program in turing. I made a pong type game and added sound whenever the ball hits off something. My problem is that everytime the program plays the "hit" sound, it has to pause and play it before it continues on. I was hoping someone could enlighten me on how to make it either go faster so the pause is hardly noticeable or just stop the pausing altogether. Thanks.

Note: I did use the search function to find a solution but no luck. Crying or Very sad
Sponsor
Sponsor
Sponsor
sponsor
Andy




PostPosted: Wed Nov 23, 2005 11:25 pm   Post subject: (No subject)

F9 fork
fear01




PostPosted: Wed Nov 23, 2005 11:58 pm   Post subject: (No subject)

Uh I have read the fork command, and tried it out but still no luck, could anyone possibly go into greater detail on using the fork command? Thanks.
[Gandalf]




PostPosted: Thu Nov 24, 2005 1:27 am   Post subject: (No subject)

Is this an external music file? Like mp3 or wav? If so, then:
code:
Music.PlayFile()


as for forks, try to avoid using them, but if you still want to learn them, I am fairly sure there is a tutorial in the tutorials section.[/code]
The_Triangle




PostPosted: Thu Nov 24, 2005 5:51 am   Post subject: (No subject)

the hit sound should be less than 3 seconds Razz
Albrecd




PostPosted: Thu Nov 24, 2005 9:29 am   Post subject: (No subject)

You should put the sound file in a process and then fork that.[/code]
do_pete




PostPosted: Thu Nov 24, 2005 1:09 pm   Post subject: (No subject)

you have to go:
code:
process Background_Music
    Music.PlayFile("filename.ext")
end Background_Music

fork Background_Music
[Gandalf]




PostPosted: Thu Nov 24, 2005 3:40 pm   Post subject: (No subject)

Sorry, I meant:
code:
Music.PlayFileReturn()


Don't use processes unless you have to - and you certainly don't in this case.
Sponsor
Sponsor
Sponsor
sponsor
do_pete




PostPosted: Thu Nov 24, 2005 4:52 pm   Post subject: (No subject)

older versions of turing dont have that
[Gandalf]




PostPosted: Fri Nov 25, 2005 4:34 pm   Post subject: (No subject)

You can say that for anything, can't you? It doesn't help, and we can assume that he (like the majority) has a version that does have the command. If not, he will post about that problem, otherwise the way I posted is best.
Furthermore, it creates problems when someone reads a post like this:
Quote:
you have to go: ...code...
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  [ 10 Posts ]
Jump to:   


Style:  
Search: