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

Username:   Password: 
 RegisterRegister   
 Play problems once compiled
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
guttface




PostPosted: Mon Feb 23, 2004 7:34 pm   Post subject: Play problems once compiled

i'm trying to get my whak-a-mole game (http://www.compsci.ca/v2/viewtopic.php?t=3711#34810) to play a sound once a mole is hit with the "play" command but when i compile it, i only get a small beep from the computer speaker. i get the same problem with the "sound" command. any ideas?
Sponsor
Sponsor
Sponsor
sponsor
Delos




PostPosted: Mon Feb 23, 2004 8:51 pm   Post subject: (No subject)

Play a .wav instead. Just make a bunch of processes (yes, I know) that will play individual sounds...like:

code:

process beep
Music.PlayFile ("beep.wav")
end beep

%...code...

fork beep



Other usefuls:

Music.PlayFileStop
playdone
the_short1




PostPosted: Mon Feb 23, 2004 9:08 pm   Post subject: (No subject)

if you want backround musik.....

try this one out...
basically same as above but....

code:

var mus : boolean := true
var soundeffect_hit : boolean := false
process musik
if soundeffect_hit = true then
Music.PlayFile ("hit.wav")
soundeffect_hit := false
mus := true
end if
if mus = true then
Music.Play.File ("broundmusik.mp3")
end if
end musik
fork musik % start backround musik


later on...
to stop bgrd musik to play a Soundeffect

code:

soundeffect_hit := true % makes it so soundeffect will play with fork
mus := false % makes bgrd musik no longer work
Music.PlayFileStop % use with above to deactivate musik
fork musik % Restart this time playing the sound effect first... then mp3


and this way it will play the sound effect first in the FORK before the backround musik... only drawback... which i dont know a way around it... this RESTARTS the backround musik.mp3..... i have posted this question to fix ... but no one has been able to sucessfully PAUSE sound...

Enjoy..
Mazer




PostPosted: Thu Feb 26, 2004 8:04 am   Post subject: (No subject)

That's because turing is... well, I'm not going to get into that right now. But I will say that it kinda sucks being able to play only one sound of each format at a time. But there is a solution to this...

Since mp3s are so much smaller than wavs, I always use them for the background music which is always longer, and then use wav files for the sound effect which are often no more than a few seconds. This works because turing can play a wav at the same time as an mp3, and since the wav files are just a few seconds you don't have to worry about transferring huge files all the time.
the_short1




PostPosted: Thu Feb 26, 2004 9:42 pm   Post subject: (No subject)

yea ... that makes no sense to discusion...or at least i am confused

anyways... you dont want to play sound effects along with musik or you cant hear them well at all....(very vaint)

so ... wondering how to pause....
thx for info on (can only play one file of one type at same time)
and taht you can play different types..
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  [ 5 Posts ]
Jump to:   


Style:  
Search: