LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do you record audio from microphone and store it as a wav file on the computer

It is working fine for me. On the Block Diagram do you have "Highlight Execution"  turned on. Look at the menu bar and see if the light bulb is yellow. If it is click it to turn it off. I only get the error when I have highlight execution turned on.

 

Robin

Message 11 of 19
(15,595 Views)

If you look at the description of the error you will see that the problem is that "The task is not running". This comes from Sound Input Read, so the problem is that the input task has stopped. The reason for that is that the buffer was filled because the VI was not reading it fast enough. Ultimately the reason for this is that the modification you made to the VI made the write task write far more data (and therefore take far more time) than the read task on each iteration. The read task can't keep up because it has to wait for the write task to finish writing before it can read more data.

There are a few ways to fix this. The first is to make the read task read in the full buffer on every iteration. You should be using 22050 as the first element (sample rate) and 100000 as the second (number of samples). Fixing those makes the VI run fine, but with glitches because now we're not writing data fast enough.

The second way to fix it (which would be better than the first) is to separate these two tasks into different threads which can run at different speeds. Put the read and write VIs in different while loops. Then you can read at one speed and write at another speed and keep both tasks happy.

 

I made a rough code with two loops. I would suggest using 100K for your Number of Samples/ch.

 

 Regards,

Juan Galindo
Applications Engineer
National Instruments
Message 12 of 19
(15,577 Views)

 

 

Hello! Could you please down-convert your example to 7.1 version?

 

 

Thanks in advance!
0 Kudos
Message 13 of 19
(15,520 Views)

I tried changing this VI to 7.1 and I obtained several warnings regarding libraries not being supported going from 8 to 7.1. Here is the resulting VI.

 

Regards,

 

 

Juan Galindo
Applications Engineer
National Instruments
0 Kudos
Message 14 of 19
(15,496 Views)

 

 

Hi!

 

Thank you for your try! However I can't open It. Seems my LV 7.1 version lacks libraries...  

0 Kudos
Message 15 of 19
(15,491 Views)

There is a library that cannot be changed to LV 7.1. Here is the VI in LV 8

 

Regards,

 

 

Juan Galindo
Applications Engineer
National Instruments
Download All
0 Kudos
Message 16 of 19
(15,453 Views)

I have to write both voltage and hum in single wav file..this is my requirement...i have used two channels in DAQ both a1 and a0.a1 to rectifier and a0 to microphone,i need to write both the values in a single wave file,can u provide me with block diagram as soon as possible....

Download All
0 Kudos
Message 17 of 19
(8,385 Views)

Hi Anuann,

 

Have you seen any similar forum posts relating to writing multiple channels to a single .wav file? I found another post that might be similar to what you are looking to do.

 

Record 4 channel audio data to a single .wav file

 

Also, this forum post is from 2009 and most likely won't see a whole lot of traffic. Because your application is different from the original post, I would advise creating a new forum post on the Multifunction DAQ discussion forum.

 

Best,

Chris D. | Applications Engineer | National Instruments

 

0 Kudos
Message 18 of 19
(8,357 Views)

how to do multi function in DAQ

0 Kudos
Message 19 of 19
(8,341 Views)