Audio Playback Interface
Libraries:
SoC Blockset /
Peripherals
Description
The Audio Playback Interface block simulates the behavior of an audio output device. The block receives audio samples as messages from a connected Audio Playback block that simulates audio driver code connected to your algorithm.
Ports
Input
msg — SoC message data
vector
This port receives data messages containing audio data from a connected Audio Playback block.
Data Types: SoCData
Output
data — Audio data frame
M-element vector | M-by-C matrix
When the block receives a single audio channel, the audio data frame is an M-element vector from a simulated hardware audio output. The Samples per frame parameter defines the number of samples, M, of audio data. When the block receives multiple audio channels, the audio data frame is an M-by-C matrix, where C is specified by the Number of channels parameter.
Dependencies
To enable this port, set the Output parameter to
To output port
.
Data Types: int8
| int16
| int32
Parameters
Output — Output type
To terminator
(default) | To output port
Specify if the block acts as a terminator, similar to the Terminator block, or produces data to an output port.
Number of channels — Number of data channels
2
(default) | positive integer
Specify the number of audio channels, C, sent to the audio device. This number must match the Number of channels parameter in the Audio Playback block.
Samples per frame — Size of data vector read from audio device
4410
(default) | positive scalar integer
Specify the number of samples per frame, M, of audio data.
Sample time — Sample time in seconds
-1
(default) | positive scalar
Enter the sample time to be used by the timer-driven task subsystem when you clear the Enable event-based execution parameter.
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
To automatically generate C code for your design, and execute on an SoC device, use the SoC Builder tool. To generate and execute C code for your SoC models, Embedded Coder® features are required. For more information on generating code for SoC designs, see Use SoC Builder to Generate SoC Design.
Embedded Coder does not generate code for this block. In the generated code, the advanced Linux sound architecture (ALSA) driver framework performs audio output on the device. The related Audio Playback block represents the ALSA driver. For more information on the ALSA driver framework, see the Advanced Linux Sound Architecture website.
Version History
Introduced in R2021a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)