MATLAB: Is there a way to play mp3 files or files other than .wav in Matlab

MATLABsound audioplayer

I could play .wav files using sound or audioplayer commands. But these can not play mp3 or other files. Is there a way to play them in MATLAB? Can we convert mp3 files to wav files?

Best Answer

You have to read them first, and the audioread function can read them. (See specifically Input Arguments filename.) You then need to create an audioplayer object to play it.
I don’t have an .mp3 file that I can find on this machine to test this, so you may have to experiment.
Related Question