Main Content

Audio File Write

Write audio frames to an audio file

  • Audio File Write block

Libraries:
Simulink Support Package for Android Devices / Audio & Video

Description

The Audio File Write block writes mono or stereo audio data to a wav or m4a file. The block accepts audio data as an M-by-N matrix, where M is the number of samples per frame and N is the number of channels.

Audio data consists of one or more channels. A mono audio source file only has one channel and a stereo audio source file has two channels.

Ports

Input

expand all

The block emits data an M-by-N matrix, where M is the number of samples per frame and N is the number of channels.

Data Types: int16

Recording the audio data can be controlled by either input port or can be specified via dialog.

Data Types: int16

Parameters

expand all

If the location of the file does not appear on your MATLAB® path, click Browse to specify the full path. If the location of this file does appear on your MATLAB path, enter only the file name.

Audio File Write block writes mono or stereo audio data to a wav or m4a. Inputs for the audio file can be 0 or 1.

The audio sampling frequency must be a positive integer value. Larger frame sizes can result in a delay in your audio input. Ensure that the audio sampling frequency matches the input sampling frequency to avoid any issues in the output.

Recording the audio data can be controlled by either Input port or can be specified via dialog. In Input control mode, control input can accept only 0, 1 and 2 as input. 0 is stop recording, 1 is start recording and 2 is pause recording.

The record time must be a positive integer value. This parameter is enabled when Record control is set to Block dialog.

The bit rate must be a positive integer value. This parameter is enabled when File type is set to m4a.

Version History

Introduced in R2019b