LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sound input read/sound input configure

Solved!
Go to solution

Hello to all readers, I have a burning question regarding an example program I changed a bit; 

I read 9.000 samples/ch in the sound input config.

For some reason, before reading the input, this number gets halved, and I don't know what the significance of this is, why have 9.000 samples in the buffer if you're only going to read 4.500? LabVIEW_.PNG

 

Thanks in advance.

 LabVIEW version 2014 Student edition

 

0 Kudos
Message 1 of 3
(2,816 Views)
Solution
Accepted by topic author Luka_Verhelle

Luke,

 

My understanding from working with sound channels in LV is that the Device ID is acting as a buffer. allowing your while loop to be working on discrete chunks of channel audio a few milliseconds behind the input stream. By decreasing size of the audio block requested in each loop you reduce the chance of the main loop requesting a block of audio that hasn't been recorded yet. 

 

You can see the results of removing the reduction step and running the Example VI. Intermittently the audio out or waveform display will 'clip' as it attempts to play audio that hasn't been written to the input Device ID channel. 

 

If you want to delve REALLY DEEP you can check out the documentation for PortAudio which has more functionality but is structured similar to the LV audio implementation (hinting at what is going on under the hood in LabVIEW). 

 

Lastly if you need more options for audio management I heartily recommend the WAVEIO plugg-in by Christian Zeitniz. It adds a lot of functionality like the WASAPI for audio which is a lot more robust. 

________/~~~~~~~~*********~~~~~~~~\________
Certified delinquent LabVIEW developer. Recertifying at next NI Days
Message 2 of 3
(2,789 Views)

It is pointless to show a truncated code picture. Instead, tell us exactly what example you modified, how you modified it and why. Then attach your modified VI.

0 Kudos
Message 3 of 3
(2,778 Views)