LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with playing different soundfiles simultaneously.

Hey.

I`m currently working on a project on school. Im trying to play different soundfiles simultaneously, each activated by an bolean input. I have tried using the "Sound File Simple Read" VI, then combining the data outputs with the adder, and finaly playing the combined signal with the play waveform.

The problem is that i can`t figure out how to activate the reading of each signal independently. Ive tried adding a switch with the path inputs on the "simple read", alternating it between the file i want to play, and a silent .wav file, but then i get an error reading "waveform have different dt values" on the adder. So i triend the Aligne waveforms VI, but that just made a mess.

The other option i tried was putting each Simple read VI in a while loop, activated only by the bolean input for each file. The problem then was that the adder would not add before every while loop was activated.

Now i am at a standstill, with no clue what to do next.

Anyone have some hints for me?

0 Kudos
Message 1 of 4
(2,320 Views)

Is this an exercise to add several waveform or do you just want to play several sounds simultaneously?

Because you don't need to add the waveforms at such a high level to play different sounds.

0 Kudos
Message 2 of 4
(2,316 Views)

It is not an exercise, but a project.

We are constructing switches on each step on a staircase, and each signal goes in the myDaq, and i use them in the LabView.
The ideas was that each step could play a soundfile simultaneously and indepentenly of eachother, but its proving harder than i tought.

0 Kudos
Message 3 of 4
(2,314 Views)

Maybe you can feed the soundoutput with small 100ms blocks and write the next block about 50ms before the last block is finished.

every 100ms block is the sum of the soundfiles activated (and scaled)

50ms should work for not realtime systems ....

The wait until only about 50ms data left in the buffer is important 😉 otherwise you will end with great delays....

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 4 of 4
(2,295 Views)