Main Content

ALSA Audio Capture

Capture audio from sound card using ALSA

Add-On Required: This feature requires the Embedded Coder Support Package for BeagleBone Black Hardware add-on.

Description

Capture the left and right audio channels from the AUDIO IN connector or a stereo sound device using the Advanced Linux Sound Architecture (ALSA) driver framework. The block output emits an N-by-2 frame of int16 values. The width of the frame, 2, corresponds to the left and right audio channels. To determine the sample rate of the block output, divide the Frame size (N) by the Audio sampling frequency (Hz). For example, if Frame size (N) is 4410 and Audio sampling frequency (Hz) is 44100, then the sample rate is 0.1 seconds.

  • ALSA Audio Capture block

Parameters

Device name

To use the default sound device that the ALSA configuration file specifies, leave this parameter set to 'plughw:1,0'.

This value comes from the ALSA configuration file, /usr/share/alsa/alsa.conf, located on the BeagleBone® Black hardware.

For more information about inspecting and configuring sound devices, see Parametric Audio Equalizer

Audio sampling frequency (Hz)

Enter the sampling frequency of the ALSA Audio Capture (input) device.

By default, the sampling frequency of ALSA Audio Capture is the same as the sampling frequency of ALSA Audio Playback.

This parameter value defaults to 44100 Hz (44.1 kHz). The maximum rate equals the sampling rate of the audio capture device.

Frame size (N)

Enter the number of samples this block outputs to your model. This parameter value defaults to 4410.

Version History

Introduced in R2014b