LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

HELP-sound file read vi does not stop at end of WAV file

Solved!
Go to solution

Hi,

I am a newbie and I am working on a project that opens a .wav file and plays it (with volume control). I found all the sound related examples to be extremely helpful and I can just modify the Sound file to Sound output.vi example for the purpose of my project.

I am running into a problem where the vi does not stop  at the end of the wav file, and it seems to loop for a while. the wav file i've been using was over a min long (and it was converted from a data file to a wav file, if that matters). I've attached my modified vi here, and appreciate any help.

 

Thank you!

 

christy

 

0 Kudos
Message 1 of 6
(3,826 Views)

Christy,

 

      I think the functionality you are looking for is that you want to play your wav file in it's entirety every iteration of the while loop. If this is the case then you just need to expand the While Loop to encompass the Sound Output Configure and the Sound Output Wait VIs and change the configure VI to Finite Samples instead of Continuous Samples. I have attached a picture showing what this looks like. If you are just wanting to play your file once and be done with it, then you can change the configure VI to Finite Samples and just get rid of the While Loop completely and then the VI will just run once. Hope this helps! 

0 Kudos
Message 2 of 6
(3,805 Views)
Solution
Accepted by topic author lumlumer

To the OP and the NI AE

Please go to help in the toolbar. Then select find examples, and search for sound. Locate the "Sound File to Sound Output.vi" 



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

Coq Rogue,

 

        That's what she started with. Now she's using the VI that she attached in her first post. My post solved the issue that she is seeing. Thanks for the help though! 

0 Kudos
Message 4 of 6
(3,788 Views)

Thank you! It fixed my problem.

=D

0 Kudos
Message 5 of 6
(3,763 Views)

G-Money  Let us not turn this into a peeing contest. But Your suggestion is  not very very good Labview practice since it open X number of sound card connections without closing them then finished. I am uncertain how big impact this will have on say memory usage. But it always a a good practice to not learn new Labview programmers bad habits. Thanks for the help though! 

And also Christy post again if got more problems. I have a lot experience with the Labview sound system.  



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 6
(3,748 Views)