Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

How can a Multi Channel Audio be played by an Audio Device with ASIO using MATLAB

Asked by Lillian Wang

Lillian Wang (view profile)

on 14 Nov 2013
Latest activity Edited by Lillian Wang

Lillian Wang (view profile)

on 14 Nov 2013

The Multi Channel Audio is written in a matrics, with 4 column representing 4 audio channels.

The Audio Device has more than 4 channels.

In Matlab, both dsp.AudioPlayer and To Audio Device Block in Simulink can be used, but only two channels are activated.

How can all 4 channel audio files be played in MATLAB?

The codes by using dsp.AudioPlayer are as follows:


H = dsp.AudioPlayer;%creating the To Audio Device

H.DeviceName='扬声器 (RME Hammerfall DSP MADI)';% this is the multi channel audio device.


H.DeviceDataType='32-bit float';





load test4Channel.mat %this is the audio matrix with sampling rate 44100, time length 45s, 4 columns.

for i=1:45;

step(H,Data((i-1)*44100+1:i*44100,:));%try to play 4 channel audio, but only 2 channels worked.


Many Thanks!!


Lillian Wang

Lillian Wang (view profile)


No products are associated with this question.

0 Answers

Contact us