04-05-2014 02:14 PM
Hi all,
I have a problem with my project. I need to acquire sound from my soundcard (16 bit, 22050Hz) for later processing. I´m using a queue with consumer-producer structure. The thing is that I need to get a constant flow of 'sample packets' of 20ms length (441 samples) at the consumer loop and now data jerks every 1 second. I've posted a picture of my code. Any help will be welcomed.
Thank you!
04-05-2014 02:29 PM
04-05-2014 02:31 PM
04-05-2014 03:59 PM
OK, as the wait is only 1mS and the sample rate is 20mS and there is no dataflow between the aquire vi and the wait(ms) the wait will not have an affect on the timing. Unless the sound input dll is somehow blocking, but i doubt that. If you post the actual VI (in LV2011/12) I will run it and see what happens. I also suggest you put a tick count (ms) in the top loop and look at the itteration timing, this may help to identify the cause of the glitch.
Michael
04-05-2014 05:38 PM
Thank you for your quick answers. I have changed the timer values and now the flow is constant but the retardation in the consumer loop is too long for this real time project.
04-05-2014 08:15 PM
Ok, so the timer bit has helped. Its 2am here so i'll keep this quick. The file write is taking too long. maybe you could try writing the waveform to a binary file, i think that is fastest. Then write another vi to post-process the binary file to the correct sound file format. That is a bit more work but cheaper than a RAID array of SSD's
If this helps please mark as solution/kudos
Thanks!
Michael.