<< 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.

Overview

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

what is mutation
Janga Reply
what is a cell
Sifune Reply
how is urine form
Sifune
what is antagonism?
mahase Reply
classification of plants, gymnosperm features.
Linsy Reply
what is the features of gymnosperm
Linsy
how many types of solid did we have
Samuel Reply
what is an ionic bond
Samuel
What is Atoms
Daprince Reply
what is fallopian tube
Merolyn
what is bladder
Merolyn
what's bulbourethral gland
Eduek Reply
urine is formed in the nephron of the renal medulla in the kidney. It starts from filtration, then selective reabsorption and finally secretion
onuoha Reply
State the evolution relation and relevance between endoplasmic reticulum and cytoskeleton as it relates to cell.
Jeremiah
what is heart
Konadu Reply
how is urine formed in human
Konadu
how is urine formed in human
Rahma
what is the diference between a cavity and a canal
Pelagie Reply
what is the causative agent of malaria
Diamond
malaria is caused by an insect called mosquito.
Naomi
Malaria is cause by female anopheles mosquito
Isaac
Malaria is caused by plasmodium Female anopheles mosquitoe is d carrier
Olalekan
a canal is more needed in a root but a cavity is a bad effect
Commander
what are pathogens
Don Reply
In biology, a pathogen (Greek: πάθος pathos "suffering", "passion" and -γενής -genēs "producer of") in the oldest and broadest sense, is anything that can produce disease. A pathogen may also be referred to as an infectious agent, or simply a germ. The term pathogen came into use in the 1880s.[1][2
Zainab
A virus
Commander
Definition of respiration
Muhsin Reply
respiration is the process in which we breath in oxygen and breath out carbon dioxide
Achor
how are lungs work
Commander
where does digestion begins
Achiri Reply
in the mouth
EZEKIEL
what are the functions of follicle stimulating harmones?
Rashima Reply
stimulates the follicle to release the mature ovum into the oviduct
Davonte
what are the functions of Endocrine and pituitary gland
Chinaza
endocrine secrete hormone and regulate body process
Achor
while pituitary gland is an example of endocrine system and it's found in the Brain
Achor
what's biology?
Egbodo Reply
Biology is the study of living organisms, divided into many specialized field that cover their morphology, physiology,anatomy, behaviour,origin and distribution.
Lisah
biology is the study of life.
Alfreda
Biology is the study of how living organisms live and survive in a specific environment
Sifune
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




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?

Ask