LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Instant sound when user enters data

I would like to play a "click" sound each time a user enters data into a numeric or string control.  I have found Play Sound File.vi however, this has to load the wav file each time. This would create too long of a delay when clicking on the keyboard. I looked for a way in Windows 7 to make a click sound when keboard is pressed but nothing that work. I found the Windows 7 On Screen Keyboard (OSK) which does behave just like I want - makes a click when pressing OSK key.  However, I don't want to use the OSK.   Is there a way to load the sound I want with Play Sound File.vi and play it immediatelty to eliminate the the delay when loading?

0 Kudos
Message 1 of 16
(3,925 Views)

Read the waveform from file once and use Sound Output Write.vi

Capture.PNGCapture.PNG


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 16
(3,920 Views)

Am I correct that you are a LabVIEW beginner and are using the Express VI?  Have you tried, instead, the "Beep" (with nothing wired to its inputs)?  It's not a "click", but it is an alert ...

 

Once you get away from Express VIs and learn better program design (like having an Initialization routine, a "Do Something, perhaps Many Somethings" in the middle, then a "Clean Up After Myself" at the end), you should be able to play whatever sound you want on a millesecond's notice.

 

Bob Schor

 

Message 3 of 16
(3,916 Views)

Bob, no I am not using an express vi. I was not aware of the Beep vi. Thanks for the heads up. I think the Alert sound would be confusing to the user. I think a "click" sound would be better. Thanks!

0 Kudos
Message 4 of 16
(3,895 Views)

Jeff, looks great. Could you re-upload as LabVIEW 2014? Thanks!

0 Kudos
Message 5 of 16
(3,892 Views)

a Snippet in 2014

Example_VI.png


"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 16
(3,879 Views)

I did exactly as in the video link you posted. I am saving the snippet to my PC. Then dragging onto my block diagram page. I still get this error message. There is not much to enter. I found the sound file VIs.  Is there any other events other than than timeout? 

 

2016-11-01 LabVIEW snippet wrong version.png

0 Kudos
Message 7 of 16
(3,863 Views)

Use the latest snipett.  If you look at the top left of the snippets you see a version number

Capture.PNG

 

That example was merely to demo a Proof-Of-Concept.  I have a custom template that allows me to generate code with a simple event loop quickly and I did not add in any code to link to your exact use needs


"Should be" isn't "Is" -Jay
0 Kudos
Message 8 of 16
(3,852 Views)

I did use the lastest snippet. I examined the png file with a hex editor.  Here is the tag/text at the end of the file that identifies the LabVIEW version:

"..EXtDescriptionLV: 14.0 11/1/2016 11:39:34 AM"

0 Kudos
Message 9 of 16
(3,846 Views)

There are only a few functions shown on the Snippet.  If you open the Sound Palette, you should be able to find them (Sound Output Read Simple, Sound Output Configure, Sound Output Write).  The non-Timeout case has a Stop button.  You should be able to "do it yourself" with the LabVIEW 2016 picture as a "blueprint".

 

Bob Schor

0 Kudos
Message 10 of 16
(3,839 Views)