MATLAB: Is there a way to open music and play it

musicmusic player

Is there a way for MATLAB to read all music files and work like a music player

Best Answer

Yeah, there is a way. Here is an example:
% Get sample audio file from the web
[y,Fs]=webread('http://www.worldnationalanthem.com/wp-content/uploads/2015/05/canada-national-anthem-mp3-free-download.mp3');
% Create a 'player' object
PO=audioplayer(y,Fs);
% Play audio
play(PO)
% Stop audio
%stop(PO)
You can find more info about 'audioplayer' here
Related Question