LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

playing sound file while rest of program continues

Is it possible to have a sound file playing (in the background) while the rest of the program continues.  I am not getting it to work.  Right now my program is waiting for the sound file to finish playing before it continues with the rest of the program.
0 Kudos
Message 1 of 8
(3,332 Views)
FIT Engineering,

You can have a sound file playing in the background if it is a separate process.  It would either need to be in a parallel dataflow branch or possibly even a separate application.  Remember LabVIEW always uses dataflow. 

How are you playing the sound now?

Thank,
Bob Young

0 Kudos
Message 2 of 8
(3,328 Views)
I want the sound file to play upon startup of the program.  The first actions of the program are included within a flat sequence.  I currently have the sound file outside of the flat sequence.  Would this not be parallel to the flat sequence if it is not within any sequence or loop?  Currently it is waiting to completely finish playing the sound file before it continues with the program.
0 Kudos
Message 3 of 8
(3,319 Views)
It works for me.  Perhaps you could post an example.

Hope that this helps,
Bob Young

0 Kudos
Message 4 of 8
(3,314 Views)
ok I sort of have it working.  I am using LV 7.1 so I needed to add a false boolean to let the rest of the program continue before it ended. 
 
My next question is to see if it is possible to have multiple sound files playing at the same time.  Essecially like background music file playing in parallel with a loop that has another sound file played such as a warning beep. 
 
thanks
0 Kudos
Message 5 of 8
(3,290 Views)

I am still looking for some help on this question.  I am wanting the outside sound to continue to play while repeated sounds are played within the loop.  Currently the outside sound is playing while the loop process starts but as soon as the beep is played the parallel sound is stoped.  Any ideas of how I can get both to play simultaneously and allow the outside sound to continue to play. 

Thanks

Here is a small sample of what I currently have.

 

0 Kudos
Message 6 of 8
(3,262 Views)
One idea is to get a second sound card and speakers.
0 Kudos
Message 7 of 8
(3,254 Views)
FIT,

The sound is stopped when the VI ends.  The VI that plays the sound launches a separate process and that process is aborted when the VI ends.  If you change your "less than" for a "greater than or equal to" it will run for 10 seconds instead of just 1 sec.  Place the .wav extention back on the sound file and it works for me.  If you do that, does it work for you?

The fact that you removed the .wav extention leads me to wonder if you are on a Windows system.  Are you?  Why did you remove the extention?  I'm guessing that you re-created the small example program and forgot it, but you could have a different system; Mac or Linux and that would mean that these VIs could behave differently.  Just checking.

Hope that this helps,
Bob Young


0 Kudos
Message 8 of 8
(3,247 Views)