04-14-2025 02:38 PM
What is the requirement?
Do you need to save the data to an audio file while collecting data?
Why don't you use the built in logging functions of DAQmx, save the data to TDMS, then post process the file and convert it to audio.
04-14-2025 04:20 PM
Hi mcduff
I don't know well. It is a for a student job that i need to prepare the ni9233 and 2 microphones to collect sound. Then she will analyse the data...
I never used the TDMS data and how to convert it as wav...
I have some experience in collecting data from sensors.
I would like to enter in the sound world (I had installed the ni sound and vibration) and replace a very old data acquisition and bigger from other company.
I could see some great examples for analysing data in S&V but it would be better saving the original (raw) data for some extra analysing.
Thanks in advance
Best regards
cpalka
04-14-2025 06:08 PM
Attached is a QUICK mod to the original file.
04-15-2025 04:00 AM
Hi mcduff
Many thanks
I will test it, but I forgot to tell you that my LB version is 2013 🙂
Could you please convert it?
Best regards
cpalka
04-15-2025 11:13 AM
v2013 attached
04-15-2025 11:57 AM
Thanks
04-16-2025 07:39 AM
@p0rg wrote:
Hahaha your post just made my day! Inspired by your method, I recorded myself counting out loud and discovered the issue-- when the consumer loop dequeues a packet of 3, the samples are appended to the waveform in reverse order. So for example, when I counted to 10, the recording saved "3,2,1, 6,5,4, 9,8,7, 10." I'm having trouble fixing this issue in my code though-- would you be able to provide some help (LV2021 VI attached)? Thanks!
sounds familiar, can you replace "Enqueue element" with "Enqueue element at Opposite End"?
04-16-2025 03:52 PM - edited 04-16-2025 03:52 PM
Dear mcduff
Here is my version with 2 channels.
I use 1 microphone and the 2nd channel is for the signal from an encoder. I need to synchronize the collected sound with the distance.
Attached is the TDMS file, from sound and encoder
Your example is great because it saves TDMS file and then it creates a wav file.
For me it was a little bit difficult because I never work with tasks. Normally I use the DAQ assistant block and configure there the channels.
By the way, the way, I use a lot for saving data the Write to measurement file, and it has the options for the file format Binary (TDMS). If I create a vi with the DAQ Assistant, configure a channel (microphone) and save the data into a Write to measurement file (Binary (TDMS))?
Best regards
cpalka
04-16-2025 04:05 PM
Good afternoon, @cpalka.
When the DAQ Assistant first came out, I was still pretty new to LabVIEW (and never did understand how to use "classic" DAQ), and DAQmx was a big improvement. However, I shortly stumbled upon a wonderful introduction to DAQmx called "Learn 10 Functions in NI DAQmx and Handle 80% of Your Data Acquisition Applications". I've memorized that site name, and have taken to renaming the Dreaded DAQ Assistant as "The Dreaded DAQ Assistant" (whose Evil Twin is the Dynamic Data Wire).
Many (most?) DAQmx "applications" can be done with 4 or 5 DAQmx calls, and you can "see what you are doing" and keep the code very simple and understandable. I strongly recommend you search for "Learn 10 Functions" (which is probably all you need to type into a Search Engine to find it), ignore Chapter 1 (which is about the DDA), and look at the next 2 or 4 chapters which should cover most of what you need to use right now.
Bob Schor
04-17-2025 02:43 AM
Hi Bob_Schor
Many thanks, I start seeing the presentation, let's see if will be this time I will start using tasks.
Could someone answer my questions in last message?
By the way I search an example vi to create a wav file from a TDMS file but could not find it.
Best regards
cpalka