LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need to write a wave file continuously to the hard disk

Hi there,

I have checked out the "Record Wave File.vi" example that comes along with LabVIEW.
However, the problem is that all the data from the input device (e.g. microphone) is stored in a buffer. Only after calling "SI STOP" it is written to the hard disk. This takes some time even up to seconds! So I need to write the data continuously to the disk. Is there a solution for my problem?

Tanks a lot,

Henning
0 Kudos
Message 1 of 6
(3,490 Views)
Hello, henkel
Yes. there is an easy solution to your problem.
1. Modify NI record wav file vi to write only .wav header ( no data at all). Wav file is a standard and, usually, it has a 44 bytes header.
2. write the header using modified vi, just to make room for the real header.
3. write the samples (if 16 bits check for endian) using append and write I16 vi and keep count of bytes.
4 once finished, use the modified vi to create and wite the real header.

OK,try it by yourself. Should you have any probems,post questions here and I will send you the NI modified vis.

cheers

Alipio.
---------------------------------------------------------
"Qod natura non dat, Salmantica non praestat"
---------------------------------------------------------
0 Kudos
Message 2 of 6
(3,489 Views)
Hi Alipio,

thanks for your quick answer!
However, I must admit that I am not that experienced in LabVIEW.
I have tried to modify the .vi for just writing the header but I get stucked�
Is it possible that you may help me out with a modified �.vi by yourself?

Thanks in advance,

Henning
0 Kudos
Message 3 of 6
(3,489 Views)
Hello Henkel.
See attached files ( vis and info).

If stucked again, post your application an I will take a look at it.( labview 7.0)

hope it helps
Alipio
---------------------------------------------------------
"Qod natura non dat, Salmantica non praestat"
---------------------------------------------------------
Download All
0 Kudos
Message 4 of 6
(3,489 Views)
 
0 Kudos
Message 5 of 6
(3,364 Views)
Hello !
 
I had a project :
   Use Sound card for saving  Wave file in 1 hour in 16k ! So I need wirte file continuously to the hard disk and modify the sound format at 16k
   
So I read this thread I did as yours recommend but I could not write the wave file as I want !
 
I modified the "Write Sound" example for my project :
            
              - I used block "Write Wave file" and modified it : I placed it within loop and removed the header part (in my oponion)
              - I used function "WaveHeader.vi" for writting header once at first and once in the end of my program.
              - I could not modify the rate "Sound Fomat" block to 16000 ( Its original rate is 8000,11025 ,22050, 44100)
 
I attached my program below, Please take a look at it !
 
Thank you very much !
0 Kudos
Message 6 of 6
(3,362 Views)