LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how can I put two sound files (in 2 cases) in the VI

I would like to ask how can I put the sound in the VI. Please, see the attached file, it only can run with 1 sound file. If I want to run 2 sound files in 2 cases, it has an error. Please help me!

Thank in advance! See you reply soon.

Best regards,

0 Kudos
Message 1 of 9
(3,256 Views)
Try setting wait until finished = True in both cases.
~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 2 of 9
(3,240 Views)
It works for me under Windows XP after I made one change. The way you built the VI, in the default FALSE case you neglected to set the "wait for completion" boolean to TRUE and that will cause the loop to continually make requests to the operating system to play the same file over and over and over without ever giving it time to start playing it in the first place. You should also consider wiring the error output of the "play" vi to an indicator so that you can see if any errors are being generated.
0 Kudos
Message 3 of 9
(3,240 Views)
Hi!
Thank for your help!
I try to fix as you told, but it just reconizes the sound file 1, when I set the main Boolean condition is TRUE, and if main condition is False, it can not play the 2nd files.
 
It informs an error in False case: code 6, source: Snd Play Wave File.vi in sent sound.vi
 
I don't know this error, so please to help, I need it in this night. Thanks a lot. If you can play, please attach the corrected file for me. Thank again.
0 Kudos
Message 4 of 9
(3,237 Views)
Your original vi works fine for me when I:
a) set wait to complete = T for both cases
b) change the file paths to a sound file present on my computer

Error 6 is a generic file I/O error (we all would get it running your vi w/ default conditions, since we don't have the file called:
C:\Documents and Settings\HOA CO MAY\Desktop\Doan so 1 chinh.wav
)

double check your path names &/or try it w/ a standard file, such as:
C:\WINDOWS\Media\CHIMES.WAV



2006 Ultimate LabVIEW G-eek.

0 Kudos
Message 5 of 9
(3,227 Views)

When you have a front-panel error displayed you can right-click on the error cluster indicator and on the menu that pops up select "Explain this error" to get mor information on the error.

In this case, error 6 is "LabVIEW: Generic file I/O error."

I suspect that one of your two sound files is bad. Try a different sound file.

(And my VI is not any different than yours other than changing the state of that one boolean from false to true.)

0 Kudos
Message 6 of 9
(3,227 Views)
Or try DIFFERENT sound files for the 2 cases to notice the change
~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 7 of 9
(3,217 Views)
Thanks all of you for your help. It can play well. One of sound files is bad file. Thanks!!!!!
0 Kudos
Message 8 of 9
(3,217 Views)
Hi! It can play well with the file I sent after adjusting. But, if I set TRUE for both of cases for "Wait until to finish" and put it in my program, it can not run my main program until the sound is off. If set FALSE, the problem likes this will occur. So, have any suggestions for this case. I want to run my program as long with the sound. Thanks a lot.
0 Kudos
Message 9 of 9
(3,208 Views)