LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

play a wav file once

how do I play a wav file just once using the play sound file.vi. i keep getting it to repeat over and over

 

thanks

0 Kudos
Message 1 of 11
(4,543 Views)

Can you post your vi?

=====================
LabVIEW 2012


0 Kudos
Message 2 of 11
(4,540 Views)

here is my vi

0 Kudos
Message 3 of 11
(4,537 Views)

I tried it and it played a wav only once. Can you try a different file or does it repeat for every file?

=====================
LabVIEW 2012


0 Kudos
Message 4 of 11
(4,521 Views)

i can get it to run once using the run button but i am creating a GUI and it has to be ran continuously so need to find a way to stop it once it has played once thanks

0 Kudos
Message 5 of 11
(4,506 Views)

First may I recommend some reading here. This is not meant to be cocky just to help you.  

Second I have included sort of template. Notice the wire that ends in the while loop. This will ensure that the wav is played before the loop starts.

Good luck with your Labview labwork

 



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 6 of 11
(4,494 Views)

Got it. You have the play vi inside of a loop right? So the question could be "How can I do anything once" and is not specific to playing a wav file.

 

The answer depends but it will generally mean you put whatever you want to execute once in a case structure.

=====================
LabVIEW 2012


0 Kudos
Message 7 of 11
(4,489 Views)

that good feedback, you learn here too, it is very true that the WAV format is important that I leave a example can provide

0 Kudos
Message 8 of 11
(4,218 Views)
Message 9 of 11
(4,203 Views)

sir,

for the same file i am not able to play the sound file as it is showing me an error- Error 4805 occurred at Play Sound File.vi->playsound.vi

"LabVIEW:  (Hex 0x12C5) Could not find the sound file."

can you provide me with some solution

0 Kudos
Message 10 of 11
(3,692 Views)