LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Play Wav File

I've got a button that's is pushed. Now I would like to play a .wav file when the button is pushed, but how do I do that ?
 
I'm a Beginner with Labview and the program that I have is writen by some one else.
0 Kudos
Message 1 of 14
(5,101 Views)
There are a couple of ways that you could do it, using the play file vi or an active X control come to mind of hand.  Below is an example of how to implement the play wav file using an event structure.  The active X is a little more complicated and is probably overkill for this situation.

The file is in LV 8, if you need 7.1 let me know.

Kenny
Kenny

0 Kudos
Message 2 of 14
(5,089 Views)
I need 7.1 Thanks
0 Kudos
Message 3 of 14
(5,086 Views)
Try this.
 
Kenny
Kenny

0 Kudos
Message 4 of 14
(5,079 Views)
It still says I need Version 8.0....
0 Kudos
Message 5 of 14
(5,077 Views)

Sorry about that.  One more time.

 

 

Kenny

Message 6 of 14
(5,062 Views)
This is Exactly what I need But how do I connect a switch from my DAQ to it ?
0 Kudos
Message 7 of 14
(5,060 Views)
What do you mean connect a switch from your DAQ?  Is there a button on you DAQ that when pressed you want it to play the sound?  What DAQ unit are you using?  Does the DAQ switch send data over RS232, through a digital output??
 
 
Kenny

0 Kudos
Message 8 of 14
(5,052 Views)
We have a gun and a light detector. When you shoot with the gun you see a laser beam coming out of the gun and hits the detector. We want that when you push the trigger of the gun, that the computer plays a .wav sound that we can specify.
 
We've got PCI6025E
LABview 7.1
I've attached the Measurement and Automation File
 
0 Kudos
Message 9 of 14
(5,048 Views)

Ok, from the looks of the channel config, you have an input the reads the guntrigger (a digital signal), and then once you get a signal from the trigger, the laser fires.

If this is true, then you would have to add in a small bit of logic to play the wav.  When the VI gets the signal from the trigger and when it "tells" the laser to fire (if the trigger returns a boolean it will be really easy), you will also need to add in either a case stucture that has the true case set to play the wave (just copy what is in the Play case from the VI I sent, minus the play button) and you can have nothing in the false case to do nothing.  Then when the trigger is pressed, you will fire the laser and play the wav.

If you need more help you may want to post a portion of your code, or at least how you are triggering the laser to fire (boolean wired to a "fire laser.vi", etc)

 

 

Kenny

0 Kudos
Message 10 of 14
(5,032 Views)