<< Chapter < Page Chapter >> Page >
Learn how to use LabVIEW to retrieve an audio signal from a WAV-format file, and how to save an audio signal that you have createdto a WAV-format file.


LabVIEW offers a variety of ways to read and write audio files in WAV format. After completing this module you will be able to use the Simple Read and Simple Write subVIs located in the “Programming | Graphics&Sound | Sound | Files” palette to retrieve an audio signal as a 1-D array from a .wav file, and also to save a 1-D array that represents an audio signal to a .wav file. Additional points covered include scaling your audio signal to have a maximum absolute value of one before saving as an audio file, and how to create a two-channel (stereo) audio file.

Retrieve an audio signal from a .wav file

The Sound File Simple Read subVI accepts a filename for an audio file in .wav format and returns a waveform data type. You can read mono or stereo files, and also determine information such as the audio signal’s sampling frequency and its total number of samples.

The following video screencast shows how to use Simple Read to retrieve the audio signal as an array data type that can be used as a signal input for your own VIs. You may want to start LabVIEW now, then follow along to create your own version of the VI pictured below. If so, you will need the two audio files referenced in the screencast: tone-noise.wav and left-right.wav .

[video] LabVIEW Techniques: Retrieve an audio signal from a .wav file

Save an audio signal to a .wav file

The Sound File Simple Write subVI accepts a signal in waveform data type and a filename and stores the signal as a .wav file. You can set the number of bits per sample (16 is recommended for best fidelity). You must ensure that your signal values lie in the range -1 to +1, otherwise other applications may not be able to read your .wav file properly.

The next video screencast shows how to use Simple Write to save an existing 1-D array that represents an audio signal to a .wav file. The screencast also covers some not-so-obvious data-type transformations required to successfully create your .wav file. You may want to start LabVIEW now, then follow along to create your own version of the VI pictured below. If so, you will need the audio file referenced in the screencast: tone-noise.wav .

[video] LabVIEW Techniques: Save an audio signal to a .wav file

Scale your audio before saving to a .wav file

As mentioned earlier, you must ensure that all of the samples in your signal lie in the range -1 to +1. It is easy to create signals that exceed this range, especially when you add multiple signals together.

The next screencast illustrates how Quick Scale is an easy way to scale your 1-D array such that the maximum absolute value is always one; Quick Scale is located in the “Signal Processing | Sig Operation” palette, and should be used as the last step before converting to the waveform data type.

[video] LabVIEW Techniques: Scale audio signal to +/- 1 range beforesaving to a .wav file

Create a two-channel (stereo) .wav file

Creating a stereo .wav file requires that you assemble an array of waveforms, one for the left channel and the other for the right channel. Watch the next screencast video to learn how.

[video] LabVIEW Techniques: Save a stereo (two-channel) audio signalto a .wav file

Questions & Answers

How we are making nano material?
what is a peer
What is meant by 'nano scale'?
What is STMs full form?
scanning tunneling microscope
what is Nano technology ?
Bob Reply
write examples of Nano molecule?
The nanotechnology is as new science, to scale nanometric
nanotechnology is the study, desing, synthesis, manipulation and application of materials and functional systems through control of matter at nanoscale
Is there any normative that regulates the use of silver nanoparticles?
Damian Reply
what king of growth are you checking .?
What fields keep nano created devices from performing or assimulating ? Magnetic fields ? Are do they assimilate ?
Stoney Reply
why we need to study biomolecules, molecular biology in nanotechnology?
Adin Reply
yes I'm doing my masters in nanotechnology, we are being studying all these domains as well..
what school?
biomolecules are e building blocks of every organics and inorganic materials.
anyone know any internet site where one can find nanotechnology papers?
Damian Reply
sciencedirect big data base
Introduction about quantum dots in nanotechnology
Praveena Reply
what does nano mean?
Anassong Reply
nano basically means 10^(-9). nanometer is a unit to measure length.
do you think it's worthwhile in the long term to study the effects and possibilities of nanotechnology on viral treatment?
Damian Reply
absolutely yes
how to know photocatalytic properties of tio2 nanoparticles...what to do now
Akash Reply
it is a goid question and i want to know the answer as well
characteristics of micro business
for teaching engĺish at school how nano technology help us
How can I make nanorobot?
Do somebody tell me a best nano engineering book for beginners?
s. Reply
there is no specific books for beginners but there is book called principle of nanotechnology
how can I make nanorobot?
what is fullerene does it is used to make bukky balls
Devang Reply
are you nano engineer ?
fullerene is a bucky ball aka Carbon 60 molecule. It was name by the architect Fuller. He design the geodesic dome. it resembles a soccer ball.
what is the actual application of fullerenes nowadays?
That is a great question Damian. best way to answer that question is to Google it. there are hundreds of applications for buck minister fullerenes, from medical to aerospace. you can also find plenty of research papers that will give you great detail on the potential applications of fullerenes.
what is the Synthesis, properties,and applications of carbon nano chemistry
Abhijith Reply
Mostly, they use nano carbon for electronics and for materials to be strengthened.
is Bucky paper clear?
carbon nanotubes has various application in fuel cells membrane, current research on cancer drug,and in electronics MEMS and NEMS etc
how did you get the value of 2000N.What calculations are needed to arrive at it
Smarajit Reply
Privacy Information Security Software Version 1.1a
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get the best Algebra and trigonometry course in your pocket!

Source:  OpenStax, Musical signal processing with labview -- programming techniques for audio signal processing. OpenStax CNX. Jul 18, 2007 Download for free at http://cnx.org/content/col10440/1.1
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Musical signal processing with labview -- programming techniques for audio signal processing' conversation and receive update notifications?