LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

multichannel waveform write to binary file

I'm sorry, but i didn't manage to record it into .wav file. i gave up and save it in binary format instead. Maybe others can give you solution
0 Kudos
Message 11 of 20
(1,402 Views)

Hi Opiq! Can you give me the Solution of writing a Multichannel Array into a binary file for .wav?
How did you manage the arrangement of the Samples?

Greets!

0 Kudos
Message 12 of 20
(1,180 Views)

Long long time ago was opiq's last visit....mh 😕
Can anyone else help?

0 Kudos
Message 13 of 20
(1,167 Views)

Hi Pulled_Down, I've been reading and I think is possible to save a Multichannel Array into a binary file but the problem is once you try to reproduce it. What are you trying to do?

0 Kudos
Message 14 of 20
(1,148 Views)

Hi Pedro!
Im trying to save a 2D Array as a binary File - continually.
First Things first:
Im reading Data from a SPI Bus - serial and Handle it with an Producer/Consumer queued FIFO. After reading the Data from the FIFO im separating
the Data per Channel and, if necessary, upsample it and convert it from U16 to Int16 - to be .wav conform.
After Doing this, the channels are saved in separate Arrays. At the MOment there are 8 Channels available - Future use is to stock up to 16 Channels.
And here the Problem:
Im trying to save these 8 Channels as Binary Data.
At the Moment im building up an 2D Array from the eight separated Channels.
When the Data is saved, i like to interpret these Data as .wav in Audacity.
Its working but not as it intended.

1. I dont know exactly how to arrange the Data for interpret is as a correct .wav afterwards.
2. How can i manage the Array and Data to save it.

I attached the Consumer Loop where the Data is separated and Saved.
The attached VI is to have a look how the Data looks i want to save.
The Attached Picture from Audacity is how the Problem looks like after load it as raw Data with 3000 Samples per Second and 16 Bit Integer - it seems the Data is saved more than one Time per Channel?!

Any Idea?
I'm grateful for any help!

Download All
0 Kudos
Message 15 of 20
(1,139 Views)

If you open the Graphics and Sound Palette and go down to the Sound File Write.vi,  doesn't that work for you?  It takes an array of waveforms and writes .wav file.

Message 16 of 20
(1,128 Views)

 Hi Pulled

 

If I am honest I am not sure how the data needs to be sorted to be read by Audacity I've been reading a little bit and I think you can use the function that RavensFan wrote or create the .wav just writting to a text file and sorting the information in the way the format needs. I found here http://www-mmsp.ece.mcgill.ca/documents/audioformats/wave/wave.html and the image and I saw that you're saving the waveforms but I think that .wav asks form more information. 

Message 17 of 20
(1,102 Views)

Yes, i tried to save the Channel's with the Sound IO but i don't know how to implement this Function exactly 😕
How has the 2D Array to look like to save it correctly or how to implement that VI?
I tried to use the Example "Sound Input to File" but it didn't worked out well.

0 Kudos
Message 18 of 20
(1,086 Views)

Hi Pulled_Down,

 

I used this with your VI to get the array into a waveform the Sound File Write.vi accepted

 

https://decibel.ni.com/content/docs/DOC-10712

 

GiantDeathRobot

William R.
Message 19 of 20
(1,063 Views)

Hi GiantDeathRobot!
Thank's for the Link! It's almost working but i have a Problem with my Ressources...streaming Data into the File as a .wav directly uses too much processing power and memory....that's pretty bad 😞
Now i try to stream the Data to Disk as Binary first and correcth then the Header to a correct .wav - the Discussion can be found here:

https://forums.ni.com/t5/LabVIEW/writing-WAV-file-contyinuously-streaming/m-p/3314867#M970927

Thank's so long! Feel free to criticise and participate... 😛



0 Kudos
Message 20 of 20
(1,044 Views)