LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to play a sound while displaying a picture?

hi, i try to create a tcp/ip connection at where a client will request a server to display a picture, and at the same time a wav file will played depends on the picture asked by the client (different music for different picture). My problem is that i totally lost how to do the simultaneous task (displaying the picture and play a certain music) while i know how to do it seperately. Any help will be appriciated. Thanks in advance.
0 Kudos
Message 1 of 7
(2,515 Views)

Hi akirasakai,

if you know how to do it seperatly, take this code and insert it side by side into a new vi. Smiley Happy

Mike

0 Kudos
Message 2 of 7
(2,512 Views)
hi mike,

sorry, but i don't really understand what you mean.
0 Kudos
Message 3 of 7
(2,508 Views)

Hi akirasakai,

you can put your code side by side into one vi. For instance two while loops parallel is no problem. Can you show your both code portions, then i can show you.

Mike

0 Kudos
Message 4 of 7
(2,498 Views)
here are what currently i've done, the problem occur within the television channel, when i pressed channel 1 (which i currently trying to input a wav file) an error occur. Can someone check it and give me some solution....thx again.
Download All
0 Kudos
Message 5 of 7
(2,497 Views)

What error number or message do you get?  What is the difference between client and server, how do you use each one?

In the server VI you have a play sound file immediately followed by a start sound task.  You don't have this in the client VI.  I'm wondering if you are trying to start something that is already playing and that is why you get an error.

You have a lot of similar code and numerous very similar cases in your case structure.  First, make sure each control has a label in the block diagram.  You may be able to reduce the amount of code you have by using arrays of references to each indicator.  Also consider creating an enum that defines the cases.  Use a type def of the enum.  This way you can use meaningful labels instead of code numbers.  And if you need to add or subtract a case, you can do it by updating the typedef of the enum.

One other problem you may have is that you have numerous picture indicators overlaying each other on the front panel.  This may cause performance issues.  Consider using only one picture indicator and feed the appropriate picture image to it depending on the case structure.

0 Kudos
Message 6 of 7
(2,468 Views)

Hi akirasakai,

same questions like Ravens Fan and a tip: you don´t need the "wait" in the client.vi in the top loop, because the loop only executes if you press a button.

Mike

0 Kudos
Message 7 of 7
(2,453 Views)