NEESgrid logo

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:
  1. Is this audio-as-data, to be analysed later?
  2. Is real-time streaming required, or will post-facto uploads suffice?
  3. How close of synchronization is required with the data and/or video?
  4. 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
  1. Captures stereo audio and saves it to disk (WAV format) at 44.1kHz, 16bits, with a software sync to other (image or DAQ) data
  2. Uploads the file to the repository afterwards
  3. Uses the computers' sound card for capture
The limitations and notes for this approach are as follows:
  1. 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
  2. Limited to two channels of capture, both with the same sample rate.
  3. No real-time streaming. It may be possible to stream audio data via the NSDS; that question is not addressed here.
  4. 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.
  5. 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

  1. Working audio input device, with microphone or other input connected
  2. LabVIEW, version 6.1 or greater, on win32 or Mac OSX.
  3. NEESGrid software distribution, in particular the LabVIEW code
  4. Network-mounted filesystem (SMB/Samba, NFS, etc) or FTP server on the repository.
  5. 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.