vicente
YaBB Newbies
Offline
Posts: 31
how to make a button with sound ?
Jan 12th , 2006, 7:51pm
I've being trying to make a button that make sounds while its being pressed. Also it's "pressed" by the system and should also make sound, in a decreasing time interval. The sound is a simple and continuos "buzz", like old computer sounds. First I tried to make a long wav file with the sound, and call play() and stop() in decreasing intervals. A loud "click" noise could be heard every time it plays or stops. This "click" noise became a real problem that I could not solve after trying a lot of differents ways. It's important to say that I got no experience in programing and that Processing is my first contact with code. I read some tutorial and start to try, so is very probably that I'm making silly mistakes, the code is as it came out and I can't even say how terrible it is. I was trying to avoid sonia couse of the need of a plugin. I tried to loop it and raise or lower the volume, but there was a click in each increase or decrease. In some hardwares you could not hear it, in others very loud. Than I tried ESS, and the same problem appears, in the various ways I tried. I went around it by making a two frames (30 fps frames) long buzz, with fade in and out in a sound editor, and looping each time less times, it's not really a good way, not just for the lack of elegance, but the sound is not very synced with the light in buttons and the sync is very dependent in the hardware performance, and very limiting. How is the way to do it ? Please help. There's a working in progress of the applet at: http://genius.kubrusly.com/fr3/ Also there is a sample of the buzz in a wav file if it could do any good at: http://genius.kubrusly.com/fr3/buzz.wav Comments very appreciated thanks VK Also comments about any thing at the code and all.