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

Username:   Password: 
 RegisterRegister   
 Help with sounds! Urgent! help ASAP!
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
chibitenshi_03




PostPosted: Thu Jan 15, 2004 7:44 pm   Post subject: Help with sounds! Urgent! help ASAP!

i have a program that is due tomorrow and i need a lot of help! i'm new to turing so i need help PLZ!
i have a box that is used for the draw,coloring ect. but i want to make it so that everytime the user draws outside the border then there would be sounds.
Sponsor
Sponsor
Sponsor
sponsor
Mazer




PostPosted: Thu Jan 15, 2004 7:50 pm   Post subject: (No subject)

code:

Music.PlayFile("filename.wav") % to play a wav file
% OR
Sound (frequency, duration) % frequency and duration both integer, make a sound
chibitenshi_03




PostPosted: Thu Jan 15, 2004 7:54 pm   Post subject: (No subject)

umm i kno the code for playing a sound but i don't know how to make it so that when the user touches the border there's a sound?
Mazer




PostPosted: Thu Jan 15, 2004 8:03 pm   Post subject: (No subject)

You want it to play a sound when the user goes outside the border? Yikes. Well, all you'd need to do is check for the mouse coordinates and compare them to the coordinates of the drawing area.

code:

% X1, Y1 - bottom left corner of drawing area
% X2, Y2 - top right corner of drawing area
% mx, my - mouse coordinates
if mx <= X1 and mx >= X2 and my <= Y1 and my >= Y2 then
    % play your sound here
end if

But keep in mind, that every time the mouse goes out of the drawing area, constantly playing the sound until the mouse goes back within the specified borders. You might want to set it up so that it plays a sound when the mouse first leaves the drawing area, and plays again only if the mouse goes back inside and leaves again. Especially if you use turings sound command, which can be brutally painful.
shorthair




PostPosted: Thu Jan 15, 2004 8:33 pm   Post subject: (No subject)

Good call by mazer , dont make hte user sit through those damn resinating frequencys, at least use an mp3 or somthing
chibitenshi_03




PostPosted: Thu Jan 15, 2004 9:59 pm   Post subject: (No subject)

thanks a lot mazer!! Surprised
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  [ 6 Posts ]
Jump to:   


Style:  
Search: