LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to have Sound Input Read VI read .wav in sections

Hi,

I'm trying to read audio data from my laptop's soundcard, and it's really slowing down my VI's processing power. I read on the NI website to read the .wav file in sections instead of as a whole, but I have no idea how to do that. Any suggestions? My VI is attached.

Thanks!

0 Kudos
Message 1 of 5
(2,790 Views)

What are you trying to do? Can you elaborate on that point. It looks like you have some major flaws in your timing strategy. Your loop speed will depend on the number of samples read from the sound card. You have a sound card samplerate equal to 22050 samples pr second, and you read 100000 samples each time. So your loop interval will be 100000/22050 seconds.



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 2 of 5
(2,777 Views)

I'm trying to take voltage from a thermocouple while recording audio through my laptop's microphone. I put the task for acquiring sound in a separate loop and increased the rate that the VI takes audio samples, and that helped processing speed, of the voltage data, but the audio data is still not acquiring. Any suggestions for making the VI run faster/the task for acquiring sound work?

Updated VI is attached.

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

You have set the sample rate for the sound card to 100000 samples pr second. That is a sample rate your sound card will not be able to handle. Hence a error will occur. And you will not get any data from the sound card. Some sound cards may support samplerates in 1 Hz step but most sound cards do only support some rates. The latter is most typical. All sound cards do support 44100 Hz sample rates but typical sample rates are 44100,22050,11025, and 8000. Some sound card do also support higher sample rates than 44100. Refer to your sound card documentation for this. Your way of using the Daq card by reading 1 sample on each iteration, using software timing is also a Daq NO-NO. Read data in chunks and do not do to many updates pr second, and always use HW timing. If you need the waveform to appear "live", or "real-time" 10 updates pr second is more than enough.  

I have included a sample vi. I suggest that you use that as your workhorse from this point. At least if you want more help from me

Tip Labview is shiped with many very useful examples. Then you are stuck. Go to toolbar->help->fFind examples. As one example the Daq setup is from the "Cont Acq&Chart Samples-Int Clk.vi" vi example



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 4 of 5
(2,749 Views)

By the way Look at the selected solution here for reading wav files in chunks

http://forums.ni.com/t5/LabVIEW/convert-csv-to-wav-file/m-p/1202203#M516756



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 5 of 5
(2,745 Views)