LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Playing several *.WAV files simultanously and with individual level control.

More specfically i need the following features:

- Independent Play/Stop for each wav-file.
- Independent loop function for each wav-file � Without skipping.
- Independent level control of each wav-file.

On the hardware side, I have to choose between an E-series DAQ card
(ie. NI PCI-6036E) or the standard Soundblaster soundcard.

I have tried the standard Sound Output functions in LabVIEW 7.0, but
they lack an effective way of looping without performing extensive
polling. Furthermore it seems impossible to playback several *.wav
files with independent levels, without having to do some extensive
array-algebra (This must be possible to do this at driver-level).
I have also looked into the CIN fun
ctions, but cant seem to figure out
if they can do the job.

In practice, I'm going to implement it with GOOP, and possibly through
the use of the (new) Event Structure.

Any advices, experiences or examples would be very much appreciated.
Thanks in advance.
0 Kudos
Message 1 of 5
(3,025 Views)
Hi,
I think you can do it in following way:
1. Read your WAV files in arrays.
2. Divide arrays into set of buffers of equal lengths.
3. Create the loop. Inside the loop you will play this buffers one after another.
4. Inside the loop add parts of different files to each other with some wheighting coefficients (volume levels). Use the result as an input for "SO Write.vi". Play this in ordinary way with "SO Start.vi"

In this case you will be able to change the volume of every file inside each itearation of the loop.

Good luck.

Oleg Chutko.
0 Kudos
Message 2 of 5
(3,025 Views)
Greetings~!

Since a WAVE file is simply an array, you can use the simple math functions to build a virtual mixer. Just use the ADD node mix each stream after you multiply them by some factor. Don't worry about fancy array algebra...to the math functions an array just looks like any other number!

Good Luck!

Eric
Eric P. Nichols
P.O. Box 56235
North Pole, AK 99705
0 Kudos
Message 3 of 5
(3,025 Views)
Hi Daniel
Just another idea:If using SoundBlaster,think about ActiveX controls. You can find good ones and use then from Labview.
Hope it helps.

Alipio
---------------------------------------------------------
"Qod natura non dat, Salmantica non praestat"
---------------------------------------------------------
0 Kudos
Message 4 of 5
(3,025 Views)
To: Oleg, Chutla & Alipio.

First of all thanks for all your fast reply's.

I think I have used a bit of everything you guys said. I had some of your ideas already, but getting them confirmed as a smart thing to do, is always good.

In my implementation, I did today, I have made GOOP classes that do the following.

- Preload some of the *.wav into the buffer
- Playback the Audio.
- Pause the Audio.
- Buffer backlog, and refill if its getting low (in here my volume control is also implemented by the Math functions, and by keeping the buffer size low I avoid that the Volume feels unresponsive)
- Stop Function

Everything works fine, but keeping buffers from underrun, even on slow computers, was the main challenge (I think it works 🙂

T
hanks again. Daniel.
0 Kudos
Message 5 of 5
(3,025 Views)