Xema
Xema

Reputation: 1886

Using audioread on a MP3 File in Matlab

I have some trouble to read mp3 file in matlab. There is the function audioread that is supposed to do the job, but it doesn't work.

>> [x Fs] = audioread('Corner.mp3');
*** audioread: problem reading Corner.mp3:Too many input arguments.
*** audioread: returning empty waveform

The function DOES work for WAV files without problem. I really don't know where do problem comes from, i searched here and using google, without success.

Have you, guys, any idea ?

EDIT : Here is the mp3 file : http://www8.zippyshare.com/v/zZQpECRF/file.html

EDIT 2 : I am using Matlab 7.12.0 (R2011a) on a Windows 8 laptop.

EDIT 3 : It seems that my Matlab version is too old. Now I'm using the R2014a version and it works perfecly !

Upvotes: 0

Views: 6208

Answers (3)

Jan-Bert
Jan-Bert

Reputation: 1005

Dan Ellis from Labrosa (columbia) have early wrote some matlab code for importing mp3 m4a and flac files.
That will also work on older Matlab versions.
Check: http://labrosa.ee.columbia.edu/matlab/audioread/
Good Luck

Upvotes: 0

krisdestruction
krisdestruction

Reputation: 1960

Your answer is not reproducible in Matlab 2015a. As hiandbaii your Matlab version is too old. Use your MP3 file and update to a newer version of Matlab and it will work.

>> [x Fs] = audioread('Corner.mp3');
>> Fs
Fs =
       44100
>> size(x)
ans =
    12899250           2

Upvotes: 1

hiandbaii
hiandbaii

Reputation: 1331

Matlab documentation says audioread was "Introduced in R2012b". I was unable to find audioread in the official 2011a matlab documentation either

Upvotes: 1

Related Questions