LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to save audio in a .wav using myrio1900

I hope this message finds you well.I am student in Vasavi college of engineering , currently working on a project knows as "Drone Detection using Acoustic Signal" that involves audio signal processing using MyRIO 1900 kit form National Instruments. As part of this project. I need to save audio file acquired from My rio kit to ".wav" file format for a duration of 30 seconds

 I have been exploring various methods but I'm encountering some challenges in achieving this specific task.If anyone in the community has experience or knowledge in this areaa,I would greatly appreciate any advice,recommendations,or example  .vi that could help me accomplish this task effectively

Thank you in advance for your assistance and support .Your insights will be invaluable in helping me progress with my project

Best regards,

Student,

Vasavi College of Engineering.

 

0 Kudos
Message 1 of 10
(336 Views)

Hi krishna,

 


@krishna134 wrote:

As part of this project. I need to save audio file acquired from My rio kit to ".wav" file format for a duration of 30 seconds

 I have been exploring various methods but I'm encountering some challenges in achieving this specific task.


What have you tried ("various methods") and what are those "challenges"?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 10
(320 Views)

Multiple questions (which would have been answered if you attached a version of your Project):

  • What version(s) of LabVIEW (year and bit-size) are you running?
  • What version(s) of the myRIO Software Toolkit are you using?
  • What is the role of the myRIO in this Project?  I'll note that LabVIEW (without the myRIO) contains functions to acquire sound data (using the PC's audio hardware) and to create .wav files.
  • Are you looking for a "solution" that using only the myRIO, without connection to a PC?

Bob Schor

0 Kudos
Message 3 of 10
(294 Views)

Thank you GerdW, for repling for my message . I collected the data form MEMO microphone and stored it into an indexed array similar to below image and run loop for 30 sec but I can't use file write here as it leading to error while collecting from the indexed array

Thank you GerdW for your support 

Best regards,

Student,

Vasavi College of Engineering.

0 Kudos
Message 4 of 10
(273 Views)

Thank you Bob_Schor for your response and willingness to assist with my project.

To address your questions:

1. I am using LabVIEW 2017(32-bit) for my project

2.Regarding the myRio Software Toolkit version, I am currently using version 2017.

3. The myRIO plays a capturing audio signals from MEMO Microphone .While I am aware the   LabVIEW (without the myRIO) contains functions to acquire sound data (using the PC's audio hardware) and to create .wav files. But my project requires the use of the myRIO with pc connection and implement machine learning algorithm such that the given audio signal is Drone,Animal,Human.etc so I am saving data from myRIO data in .wav file and using matlab script find the  signal. Hence I am seeking guidence on how to accomplish the task of saving audio data directly from MyRIO to .wav file  format.

If you have any further insights or recommendations based on this context,I would greatly appreciat your assistance.

Thank you again for your help

Best regards,

Student,

Vasavi College of Engineering.

 

0 Kudos
Message 5 of 10
(268 Views)

Hi krishna,

 


@krishna134 wrote:

I can't use file write here as it leading to error while collecting from the indexed array


I don't understand this sentence.

Which errors do you get when trying to save data to a file?

Where is the file located/ which filepath do you use?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 10
(257 Views)

     I'm puzzled by the "requirements" you seem to have in place for this Project.  It goes against the true strengths of the myRIO and the LabVIEW Real-Time environment, augmented by the myRIO's FPGA.  This environment provides you with three computers working together, all three programmable in LabVIEW, and all having independent "niches" to fill in facilitating the goal(s) you seem to have sent for your overall Project.

 

     The PC has access to gigabytes of memory, fast I/O to terabytes of storage, access to a wealth of software (including, potentially, AI applications, not to mention WAV decoders, MatLab, etc.).  What it doesn't have is a robust Real-Time Operating system (though it can come close by handing off the RT Timing to DAQ equipment and/or partnering with Real-Time OS platform like the NI CompactRIO family of devices, including the myRIO).  Many of these Real-Time platforms also have access to a built-in third computer running software on an FPGA, providing a true parallel processor running at a high clock rate and linked to the Real-Time Processor via DMA transfers.

 

     If the goal is to complete a (poorly-conceived) "school Project" for a class where Matlab is the "tool to do the analysis" with the added (silly) restriction that you need to use the myRIO to save sound data from a specific microphone (which presumably gives you "sampled data", potentially as a stereo (or 2-channel) Waveform and "packaged" as a .wav file (which is trivial to accomplish on the PC!, and much easier to save as a really large file, far exceeding the meager myRIO memory).  Now, when you want to do AI analysis, where will this take place?  I assume on the PC, unless you are porting the AI routines to the myRIO and its FPGA ...

 

Bob Schor

     

0 Kudos
Message 7 of 10
(238 Views)

 

Hello Bob,
 
Thank you for your thoughtful response and for sharing your insights on the strengths and capabilities of the myRIO and LabVIEW Real-Time environment.
 
I understand your concerns about the potential limitations of using the myRIO for this project, especially considering the robust capabilities of a PC environment. Allow me to provide some context for the project requirements:
 
While it may seem unconventional, the project specifications are driven by real-world constraints and objectives. In certain applications, such as remote monitoring or embedded systems, there may be requirements to perform specific tasks autonomously without relying on a PC connection. In such scenarios, leveraging the myRIO's real-time processing capabilities becomes essential.
 
The goal of this project is to develop a standalone system capable of capturing audio data in real-time using the myRIO and subsequently performing analysis or processing tasks directly on the device itself. This approach offers advantages in terms of portability, simplicity, and reliability
 
In terms of AI analysis, I implement a decision tree using matlab using that generated tree I constructed it using if else block as shown in below file that was shared which is without Myrio and corresponding .vi file shared below.
 
I appreciate your perspective and welcome any further insights or recommendations you may have based on this context.
 
Best regards,
Student ,
Vasavi College of Engineering.
Download All
0 Kudos
Message 8 of 10
(173 Views)

Hello GerdW,

Thank you for your response.

To clarify, when I mentioned "error while collecting from the indexed array," I was referring to an issue I encountered while attempting to save audio data from an indexed array to a .wav file using file write functions in LabVIEW.

Specifically, the error I encountered was related to the file write operation failing to execute properly, possibly due to incorrect file paths or permissions.

To address your questions:

1. The specific errors I encountered were not explicitly stated in my previous message, 
2. As for the file location and file path used, I attempted to save the .wav file to a directory on the PC .

I hope this provides some clarity on the issue I'm facing. Any guidance or recommendations you can offer to resolve this file writing issue would be greatly appreciated.

Best regards,
Student,

Vasavi College of Engineering.

0 Kudos
Message 9 of 10
(170 Views)

Hi krishna,

 


@krishna134 wrote:

Specifically, the error I encountered was related to the file write operation failing to execute properly, possibly due to incorrect file paths or permissions.

 

2. As for the file location and file path used, I attempted to save the .wav file to a directory on the PC.


The myRIO is a computer on its own and it has NO access to the hard drives of your computer!

 

LabVIEW comes with a huge example library and a lot of example projects. There are examples on how to transfer data between a RIO RT system and your Windows host computer…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 10
(160 Views)