Audio File Read
Add audio file from computer into mobile application
Add-On Required: This feature requires the Simulink Support Package for Android Devices add-on.
Libraries:
Simulink Support Package for Android Devices /
Audio & Video
Description
The Audio File Read block copies an audio source file into your model and outputs the audio data into the model. The block outputs audio data as an M-by-N matrix, where M is the number of channels and N is the frame size of audio data.
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. The audio data is output from the block as frames consisting of
M
consecutive samples of audio data.
Algorithm
The sample time of the Audio File Read block is determined automatically by the data frame size and audio frequency of the selected audio file.
Sample time = frame size / audio frequency
For example, if the audio frequency is 44,100 Hz and the frame size is 4410 samples, then the block sample time is 4410 / 44,100 = 0.1 seconds.
To select an audio source file, use the File name parameter. The audio frequency of the selected file displays on the block.
Note
To maintain audio quality, in blocks connected to the Audio File Read block, set the sample time to inherited.
Ports
Output
Parameters
Version History
Introduced in R2017a