Log in

View Full Version : Playing .wav's on the dashboard...


ProgrammerJoe
09-03-2010, 14:38
Hey guys,

As we start to work on the final tweaks and touches of the robot, I was looking for someone who had experience with the sound vi's in Labview. Our plan was to have different .wav files playing looped on the dashboard, corresponding to the targeting arrows on the top of the camera, and then have a joystick command be able to toggle the alert on and off. To suppliment this, we bought a USB audio device and plugged a pair of dime store headphones into it to comply with <R82>. However, the code works fine realitive to Labview and the sound is referenced and told to play, but it doesn't actually play the sound. Does anyone have any experience with this niche of vi's that is willing to lend a hand?

Zme
09-03-2010, 14:40
make sure that the audio output device is set up correctly, if its not it could be trying to output to the speakers which are most likely muted,

ProgrammerJoe
09-03-2010, 14:50
I tried it with just the speakers on to get a control, and it still didn't work. So I'm assuming that either there is some other necessery piece that I am unaware of, or it's a mind numbingly stupid mistake.

Zme
09-03-2010, 14:51
i'll look at what i have for this and get back to you,

ProgrammerJoe
09-03-2010, 15:02
Thanks, I also updated the original post to make it more specific to the end goal of the program.

Zme
09-03-2010, 15:03
ok then,
there are a couple ways of going about it, you can use the play sound file vi which takes in a device number and a file path, or the play waveform express vi which lets you choose the output device from a list, those are the simplest that i see, though someone else may have a better idea

ProgrammerJoe
09-03-2010, 15:06
I used the play sound file vi, and according to the lightbulb, it plays the sound. Problem is, it doesn't make a peep in the real world. But I'll take a look at the play waveform express vi, and get back to you.

Joe Johnson
09-03-2010, 15:14
Are you willing to write your own .NET program?

There are pretty easy ways to play sounds via WMP in combination with .NET framework. I don't have any VB examples on the PC I am on now, but as I recall it was a near trivial program. It is pretty much just a matter of instancing a class and calling a method with the file name as an argument.

Joe J.

ProgrammerJoe
09-03-2010, 19:04
Status Update:

The latest build of the dashboard works ok soundwise, using the waveform vi's. But having it play the sounds limits camera feedback time and slows it down to the point of the circle that denotes the camera noticibly outruns the picture taken by the camera. I'm probably going to use generic beeps, or switch out for another dashboard alltogether. Thanks for the help, though.