Main Content

Audio Playback

Playback audio samples from an algorithm to an output audio device

Since R2021a

  • Audio Playback UI Icon

Libraries:
SoC Blockset / Peripherals

Description

The Audio Playback block simulates behavior of the driver code that plays audio to an audio output, such as a speaker, on a hardware board. The output of this block must be connected to an Audio Playback Interface block that simulates a physical audio device on the hardware board. Place this block inside a task and connect to an algorithm to output a frame of audio samples each time the task executes. For more information on tasks, see Timer-Driven Task and Event-Driven Tasks.

Ports

Input

expand all

Audio data frame to be sent to an audio playback device, specified as an M-element for single channel audio or as an M-by-C matrix for multi-channel audio. C is specified by the Number of channels parameter.

Data Types: int8 | int16 | int32

Output

expand all

This port outputs data messages containing audio data to a connected Audio Playback Interface block. For more information on messages, see Messages.

Data Types: SoCData

Parameters

expand all

Specify the number of audio channels, C, in each audio data sample.

Extended Capabilities

Version History

Introduced in R2021a