How can a Multi Channel Audio be played by an Audio Device with ASIO using MATLAB
7 views (last 30 days)
Show older comments
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:
clear;clc;
H = dsp.AudioPlayer;%creating the To Audio Device
H.DeviceName='扬声器 (RME Hammerfall DSP MADI)';% this is the multi channel audio device.
H.SampleRate=44100;
H.DeviceDataType='32-bit float';
H.BufferSizeSource='Auto';
H.QueueDuration=2;
H.ChannelMappingSource='Property';
H.ChannelMapping=1:4;
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.
end
Many Thanks!!
0 Comments
Answers (0)
See Also
Categories
Find more on Audio I/O and Waveform Generation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!