Dear NI Forum,
I am running LabVIEW 8.2 on Linux (Scientific Linux 4.5, 2.6.9-78.0.13) and am trying to get a .wav sound file played repeatedly. I followed the example in the LabVIEW help, but it only plays once (see attachment) - the text stated it will "continually play a sound file". Hopefully it is an easy oversight on my part on how this is done.
see your modified vi.
don't forget Kudos for good answer
Thanks. It plays once, but then hangs on the 'Play Sound File.vi" during the next iteration. I need to kill LabVIEW in order to stop the VI. I noticed the VI you attached was done in 8.5, could you check in 8.2 if you can re-produce the error?
I dont have labview 8.2, but in labview 8.5 that example is working fine for me.
wait i ll try different solution and will get back 2 u
Try this. i have done slight change in the code. i hope it will work for you
Sorry for the delay - on the East coast of the US.
The VI still hangs on the second iteration. I traced it to the "Call Library Function" in the Play Sound File.vi. Any thoughts on this? Too bad I don't have my 8.5 installers with me.
Thanks for the help,
Labview is shipped with a lot of examples. Also sound. Have you tried help->Find examples. Also if you are new to Labview always enable content help. And use the detailed help option, then in doubt. From this I found this note "You must have the Open Sound System (OSS) driver to use this VI" if your system hangs it could be something with this driver. Since I do not think a 8.5 VI can be opened in 8.2. But have tried to recompile the VI from Gaurav?
You can use save for previous version for saving VIs in say 8.2
Hi Coq rouge,
The first thing I did was look at the examples provided by NI – been programming in LabVIEW for ten years now 🙂 The funny thing is as I had posted initially the "playing sound continually" example doesn't work the way it is advertised – nor do I see it ever working, given that the "Play sound file" VI is outside of the while loop.
I will look into the OSS driver – new to Linux so it might take a bit of googling around (best way to learn).
I actually opened up the 8.5 VI on my Mac and then manually recreated it in 8.2 on Linux. One thing I noticed is the sound VI's are different from Mac and Linux. On my Mac I only need a single VI to play the file and to loop it I just have it in a while loop.
Tried the -1 for the timeout and I got the same result of hanging on the second iteration.
Thanks for the suggestion, I hope there is a solution to it other than upgrading to 8.5 or using a different Linux flavor.
Sorry I did not know you have 10 years of experience. But I know the Labview sound driver in windows very well. The input part is very good but the output part stinks like a skunk if you want to use it as a continuous glitch free waveform generator. But anyway this problems should have nothing to do with your problem. I tested the latest suggestion from Gaurav. I works and by setting the timeout to -1 the "Sound play" VI will not end before the sound is played. So I think the OSS might be the problem. But well my Linux knowledge will not cover even my smallest fingernail so I shall not be cocky. Even if my nick is Coq Rouge 😉