LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

multiple sound play using COM port

hi all,

I am trying to make a project where i have to store 16 .wav files in 16 temporary buffers  and play them with volume control recieved from COM port.

Like

 

 CMD1 (0,12,56,0,78,1,34,56....).

 CMD2 (0, 80,56,12,0,12,......)

@Baudrate 115200

 

 

Also if we recieve CMD2 before we are finish playing the sounds of CMD1,then current sounds shoul be stopped and played again from start with specified volume.

 

Eg: when CMD2 is recieved sound2 is stopped and played again with volume 80.

File 2 will be played with volume 12 at the same time file 3 will be played with volume 56.

 

Help needed

1)how to make parallel execution loops with Main loop controlling the Child loops.

Like

 

(MAIN-LOOP) //detect which loop is to be played and go-to that loop or case structure

           {

              (LOOP-1)  subprogram1

              (LOOP-2)  subprogram2

            }

 

 

2) Please guide me on how to stop/play the file at particular events.

    I have read about buffering of sound files in Examples.

 

3)If anybody has some VI simililar to any part of this project.then please share  :robottongue: .

 

 

I recently tried to play the file on break eents recieved from serial port but it did't work as files take some time to fininsh.

 

Thanks

divgup

 

 

0 Kudos
Message 1 of 6
(3,501 Views)
Your images are all screwed.
0 Kudos
Message 2 of 6
(3,468 Views)

I did not attached any images .

However if anything else is unclear please tell me.

0 Kudos
Message 3 of 6
(3,463 Views)

hi Divgup,

 

try out the following and tell if it solves your problem or not.

 

1) You can use the case structure to switch between the two cases.

 

2) To play/stop .wav files you can find the VIs present in Programming>>Graphics and Sound>>Sound>>Output.

0 Kudos
Message 4 of 6
(3,435 Views)

my incoming data is from serial port.

I was successfull in showing that on a graph(x,y) (0.00 to 5.00 Volts)

Now i have to use this serial input in selecting the case structure i have to run.

I am able to run the case structure example.

 

I have also run the wav file example shown by you.

I played it in a timed loop.

But it has to stoped and playde again whenever the time loop expires i am not able to do this.

 

 

For example.:

The value coming from the port is : 3,3.55

So it means 3 file stored in the Wave file buffer is to be played with 3.55 volume level where 5V is assigned as full voltage level.

0 Kudos
Message 5 of 6
(3,420 Views)

Why are you not able to play/stop the file. What problem are you facing.

Is it possible for you to post your vi.

0 Kudos
Message 6 of 6
(3,386 Views)