在 Matlab 中对 MP3 文件使用 audioread

Using audioread on a MP3 File in Matlab

我在 matlab 中读取 mp3 文件时遇到一些问题。 有一个函数 audioread 应该可以完成这项工作,但它不起作用。

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

该函数可以毫无问题地用于 WAV 文件。我真的不知道问题出在哪里,我在这里搜索并使用 google,但没有成功。

伙计们,你们有什么想法吗?

编辑:这是 mp3 文件:http://www8.zippyshare.com/v/zZQpECRF/file.html

编辑 2:我在 Windows 8 笔记本电脑上使用 Matlab 7.12.0 (R2011a)。

编辑 3:看来我的 Matlab 版本太旧了。现在我使用的是 R2014a 版本,它运行得非常好!

您的答案无法在 Matlab 2015a 中重现。 你的 Matlab 版本太旧了。使用您的 MP3 文件并更新到更新版本的 Matlab,它会起作用。

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

Matlab 文档说 audioread 是 "Introduced in R2012b"。我也无法在官方 2011a matlab 文档中找到 audioread

来自 Labrosa(哥伦比亚)的 Dan Ellis 很早就编写了一些用于导入 mp3 m4a 和 flac 文件的 matlab 代码。
这也适用于较旧的 Matlab 版本。
检查:http://labrosa.ee.columbia.edu/matlab/audioread/
祝你好运