Click sound when a button is pressed?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
Tukcedo
Posts: 65
Joined: Fri Jun 27, 2014 9:43 pm

Click sound when a button is pressed?

Post by Tukcedo » Tue Jan 13, 2015 9:53 pm

Dear all,

Please excuse my (formidable) ignorance, but is there a simple way of producing a subtle "click" sound when a button is pressed. Having read up on it, I suppose I could just play a WAV, but that might incur too much overhead. It's for Android by the way, or should I say "mobile".

Thanks!!!

Mich.
Michel J.L. van der Kleij
Coding to help stray animals in the Philippines
Albert Foundation - http://albert.tukcedo.nl
Aklan Animal Rescue & Rehabilitation Center - http://aarrc.tukcedo.nl

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6117
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Click sound when a button is pressed?

Post by dunbarx » Wed Jan 14, 2015 2:19 am

Hi.

Can't you record a "click" as a small audio clip and play that?

Craig Newman

Klaus
Posts: 11112
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Click sound when a button is pressed?

Post by Klaus » Wed Jan 14, 2015 1:33 pm

dunbarx wrote:Hi.

Can't you record a "click" as a small audio clip and play that?

Craig Newman
I think that will be the only solution to his problem!

Tukcedo
Posts: 65
Joined: Fri Jun 27, 2014 9:43 pm

Re: Click sound when a button is pressed?

Post by Tukcedo » Wed Jan 14, 2015 6:50 pm

Hmmmm yeah that was my original idea too, but any ideas on the overhead guys?
Michel J.L. van der Kleij
Coding to help stray animals in the Philippines
Albert Foundation - http://albert.tukcedo.nl
Aklan Animal Rescue & Rehabilitation Center - http://aarrc.tukcedo.nl

Klaus
Posts: 11112
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Click sound when a button is pressed?

Post by Klaus » Thu Jan 15, 2015 12:25 pm

Mijnheer,

do you want to hear a click sound or not? 8)
If yes, then you will need to live with some KB overhead! :D


Best

Klaus

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 5084
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Click sound when a button is pressed?

Post by jacque » Thu Jan 15, 2015 10:50 pm

For short audio that doesn't need high fidelity I often import an audio clip into the stack. It keeps the sound together with the stack so you don't need a separate file on disk, and it sounds fine for things like clicks and beeps. The best format is aiff for something like this. There is almost no overhead when an audio clip is part of the stack and playback will be near-instant. If you do decide to use an audio file on disk instead, the overhead is minor but does take a little longer to start because the file has to be loaded into RAM.

Try it both ways and see which one works best for you.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Klaus
Posts: 11112
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Click sound when a button is pressed?

Post by Klaus » Fri Jan 16, 2015 12:11 am

Hi Jaqueline,
Tukcedo wrote:... It's for Android by the way, or should I say "mobile".
which eliminates the option of imported audio clips 8)


Best

Klaus

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 5084
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Click sound when a button is pressed?

Post by jacque » Fri Jan 16, 2015 2:48 am

Oops, you're right. Files it is then. I missed that.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Tukcedo
Posts: 65
Joined: Fri Jun 27, 2014 9:43 pm

Re: Click sound when a button is pressed?

Post by Tukcedo » Fri Jan 16, 2015 6:52 pm

Hmmm so why wouldn't an imported sound file not play on Android? It doesn't (I checked that) and the imported file doesn't even show anywhere. How can I remove it since I can't use it anyway?

I included (copy) an mp3 file and that works quite well with the file reference. Now hunting down a nice "subtle" click ;-)
Michel J.L. van der Kleij
Coding to help stray animals in the Philippines
Albert Foundation - http://albert.tukcedo.nl
Aklan Animal Rescue & Rehabilitation Center - http://aarrc.tukcedo.nl

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 5084
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Click sound when a button is pressed?

Post by jacque » Sat Jan 17, 2015 9:42 pm

In LC preferences -> Application Browser, turn on the checkbox that shows audio files. Open the app browser, click on your stack in the left-hand list, and the imported audio files will appear. Right-click and choose Delete to remove them.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Tukcedo
Posts: 65
Joined: Fri Jun 27, 2014 9:43 pm

Re: Click sound when a button is pressed?

Post by Tukcedo » Mon Jan 19, 2015 9:53 pm

Thx Jacque, that tickbox was already checked and now audio file to be seen. Perhaps it just didn't accept the sound file at all.
Michel J.L. van der Kleij
Coding to help stray animals in the Philippines
Albert Foundation - http://albert.tukcedo.nl
Aklan Animal Rescue & Rehabilitation Center - http://aarrc.tukcedo.nl

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”