LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Linux LabVIEW 8.2, playing looped .wav

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.

 

Thanks,

Bertrand

0 Kudos
Message 1 of 13
(3,063 Views)

hi,

 

see your modified vi.

 

 

 

Best luck

Gaurav kSmiley Happy

don't forget Kudos for good answer

 

Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.
0 Kudos
Message 2 of 13
(3,054 Views)

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?

 

Bertrand

0 Kudos
Message 3 of 13
(3,049 Views)

hi

 

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

 

 

 

Gaurav kSmiley Happy

Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.
0 Kudos
Message 4 of 13
(3,047 Views)

hi

 

Try this. i have done slight change in the code. i hope it will work for you

 

 

 

Best luck

Gaurav kSmiley Happy

Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.
0 Kudos
Message 5 of 13
(3,043 Views)

Hi Gaurav,

 

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,

Bertrand

0 Kudos
Message 6 of 13
(3,019 Views)

Hi

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?

@Gaurav

You can use save for previous version for saving VIs in say 8.2



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 7 of 13
(3,014 Views)
Also try to set the timeout to -1


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

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.

 

Bertrand 

0 Kudos
Message 9 of 13
(3,003 Views)

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 😉



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 10 of 13
(2,996 Views)