Audio Capture with LabVIEW
Paul Hubbard
September 15, 2003
Version 1.0
Introduction
In addition to the work with image/video capture, some sites have
expressed an interest in also capturing an audio feed from their
laboratory, and saving it as part of their data. Several issues arise
from this request:
- Is this audio-as-data, to be analysed later?
- Is real-time streaming required, or will post-facto uploads
suffice?
- How close of synchronization is required with the data and/or
video?
- Scalability requirements: Number of channels, sample rate, bit
depth.
Proposed solution
From this range of requirements, we have chosen to implement a
reference solution in LabVIEW that addresses what we hope is a
first-sigma set of needs. That is, we will deliver LabVIEW code that
- Captures stereo audio and saves it to disk (WAV format) at
44.1kHz, 16bits, with a software sync to other (image or DAQ) data
- Uploads the file to the repository afterwards
- Uses the computers' sound card for capture
The limitations and notes for this approach are as follows:
- Sample clock drift - this approach uses the sample clock on the
sound card, and will therefore not be sample-accurate with the DAQ and
video data. Sites requiring exact sync will need to purchase audio
capture boards capable of external synchronization, such as the
National Instruments PCI-4451
2-channel PCI board
- Limited to two channels of capture, both with the same sample
rate.
- No real-time streaming. It may be possible to stream audio data
via the NSDS; that question is not addressed here.
- Not synchronized with the telepresence (TPM) video. Adding audio
to the telepresence is a different set of problems (e.g., supported
digitizers and codecs, client-side support, etc) and is not covered
here.
- 44.1kHz maximum sample rate, 16 bits per sample. (Lower rates and
8 bit capture are possible, depending on your sound card and operating
system.)
Many of these limitations are easily remedied by buying a more capable
board from NI or other supported vendor; available are up to 8
channels, 24 bit, 96kHz, etc. If you need many channels, you can
purchase a PXI chassis and boards, which NI claims is scalable up to
5000 (synchronized) channels.
Prerequisites
- Working audio input device, with microphone or other input
connected
- LabVIEW, version 6.1 or greater, on win32 or Mac OSX.
- NEESGrid software distribution, in particular the LabVIEW code
- Network-mounted filesystem (SMB/Samba, NFS, etc) or FTP server on
the repository.
- NFMS 'scraper' running on the repository to ingest the data file
Audio Notes and suggestions
Additionally, if you are concerned with high-fidelity capture, a small
mixing board such as the the Mackie
1202, the Yamaha
MX12/4, or the Behringer
1604A, is quite helpful. Note that audio recording is harder than
it appears at first blush, and will require some effort on your part to
get consistently good results.
A good voice microphone is the Shure SM-58;
the SM94
has a broader and flatter frequency response for non-vocal uses.
More Information
This
NI page of '10 Questions to Ask When Selecting Your Sound and
Vibration Measurement System ' covers many issues, and is a useful
read. Covers their hardware and software targetted at sound and
vibration.
Note that a general-purpose DAQ board can also be used to capture
audio, though some code changes will be required. LabVIEW uses
different routines to access the sound card and DAQ boards, though they
are similar enough that one could easily use either.
Navigation links
Back to NEESgrid page
Back to home page
Support
This work was supported primarily by the George E. Brown,
Jr. Network for Earthquake Engineering Simulation (NEES) Program of
the National Science Foundation under Award Number CMS-0117853.