LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with Sound Input VI's. Buffer Size discrepency. SI Clear not releasing resources?

I am writing an app which requires a VU meter type display of the signal on the mic input (8bit 44100Hz). To aquire the data I call SI Config, SI Start, wait 5ms, SI Stop, SI Read and then SI Clear.
If I call SI Config once, loop the Start, Read, Stop section and then call Clear, the buffer size in SI Config has to be enormous (~16000) where for a stereo signal with a record period of 5ms it should be about440.
If I loop the whole thing and call SI Config and SI Clear before and after every aquisition, the buffer size can be more reasonable, but after a while I either get "ERROR # 3 'memory.cpp' line 563" and LabView is shut down or if I try to open another windows app li
ke Explorer, I get a "Not Enough Memory" error.
I have attached some sample code.
0 Kudos
Message 1 of 5
(3,808 Views)
I can understand the issue about having a buge buffer when you only call Clear once. SI Clear erases the buffer. If you continue to acquire before calling it, it tries to save the data and will create a huge buffer like you are seeing.

About the errors you are seeing, I have not seen this before. However, I was searching for you and found this Knowledge Base on NI's website. It says that the Delete Array function can cause the exact behavior you are seeing. Either the "Out of Memory" error or the "memory.cpp line 563" error. I believe this is more than a coincidence. If you are not calling this VI, then maybe it is being called from within SI Clear? Let us
know what you find out.
J.R. Allen
0 Kudos
Message 2 of 5
(3,807 Views)
I have to build a VU meter display at LV, But I couldn't find any information in NI web except yours.

I'm not an audio engineer. If you share how to make VU meter, it will be helpful to me.
Please let me get it.

Thanks.
0 Kudos
Message 3 of 5
(3,807 Views)
Hi,

I've attached an example which shows continuous audio level in dBs.The code is not pretty, but it should give you a good idea of how to go about it.

Mike.
0 Kudos
Message 4 of 5
(3,808 Views)

Hi mike

 

 

Thanks mike

0 Kudos
Message 5 of 5
(3,094 Views)