
-----------------------------------
fear01
Wed Nov 23, 2005 10:14 pm

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.  :cry:

-----------------------------------
Andy
Wed Nov 23, 2005 11:25 pm


-----------------------------------
F9 fork

-----------------------------------
fear01
Wed Nov 23, 2005 11:58 pm


-----------------------------------
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]
Thu Nov 24, 2005 1:27 am


-----------------------------------
Is this an external music file?  Like mp3 or wav? If so, then:
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
Thu Nov 24, 2005 5:51 am


-----------------------------------
the hit sound should be less than 3 seconds :P

-----------------------------------
Albrecd
Thu Nov 24, 2005 9:29 am


-----------------------------------
You should put the sound file in a process and then fork that.[/code]

-----------------------------------
do_pete
Thu Nov 24, 2005 1:09 pm


-----------------------------------
you have to go:
process Background_Music
    Music.PlayFile("filename.ext")
end Background_Music

fork Background_Music

-----------------------------------
[Gandalf]
Thu Nov 24, 2005 3:40 pm


-----------------------------------
Sorry, I meant:
Music.PlayFileReturn()

Don't use processes unless you have to - and you certainly don't in this case.

-----------------------------------
do_pete
Thu Nov 24, 2005 4:52 pm


-----------------------------------
older versions of turing dont have that

-----------------------------------
[Gandalf]
Fri Nov 25, 2005 4:34 pm


-----------------------------------
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:
you have to go: ...code...
