LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sound start vi

Hello,
 
I would like to know dynamically if the VI SO start has finished to play the sound.
I don't want to use the VI SO wait.vi because the user must be able to stop the sound.
At the end on the VI SO start, I want to put the stop button at true by program.
Thanks.
 
cinsm
 
0 Kudos
Message 1 of 5
(3,148 Views)
Hello,

Can you know how long does the sound spend?
Is it a finite or continue (in a while loop)sound?
What version of LabView do you use?

If you did one, can send me a simplified example of  your  vi.

Johan G. NIF 

0 Kudos
Message 2 of 5
(3,124 Views)

Hello,

Thank you for your answer.

I use LabVIEW 7.1.

So start.vi plays a wave file choosed by the user and I don't know how long it does (1s. or 2 min...).

The VI joined is a LabVIEW example because my program is too complex.

You can open a wave file and clic on the play button. At the end of the VI so start we can't quit the VI. I want to put dynamically the stop button at true, to be able to clic the quit button.

cinsm

 

0 Kudos
Message 3 of 5
(3,114 Views)
Hello,

Ok, I understand your problem.

You can try to do that:
As shown in the example you send to me, you can obtain some informations about the sound you play.

The can determinate the duration of the sound dividing the number of sample you write by the sampling rate.
To obtain the number of samples writen you just need to take the size of the array you put in the "write vi".
Once you have the duration of the sound, you can set a stop condition in the while loop to get out of it and stop the application.
I think it can be a solution.

Otherwise, if you just need to play a sound, you can also use a container activeX which uses Window media player to play the sound.

Hope I could help you.

Johan G. NIF 
0 Kudos
Message 4 of 5
(3,107 Views)

Thank you for your help.

This solution helps me.

Sincerily.

cinsm

 

0 Kudos
Message 5 of 5
(3,096 Views)