For those who are confused about the Line 67/ line 50 errors, I think I've found the answer. Presumably you all are not using Windows - which becomes an issue when the mp3read function attempts to access mpg123.exe (as well as lame.exe and others). Exe files are not executable by macs or linux... hence the problem. The reason wavread can't open the file is because there's nothing in it. It's still the temporary wav file that tempfile was initialized with.
Fortunately, there are mpg123 and lame files that have been made for mac and linux. You can find them here: http://www.mathworks.com/matlabcentral/fileexchange/13852-mp3read-and-mp3write/all_files. Put the .mac or linux files in your directory and you should be fine.
Then just substitute this code in for line 42 (if you're a mac user):
[stat,raw_info] = dos(['"' location,'/mpg123.mac"', ' -w ', tmpfile, ' ', '"',FILE,'"']);
Hope this works for ya'll.
I am trying to read an mp3 file using the mp3read function. And I am always getting this error :
Error using wavread (line 67)
Invalid Wave File. Reason: Cannot open file.
Error in mp3read (line 50)
[Y,FS,NBITS] = wavread(tmpfile); % Load the
data and delete temporary file
Anybody knows any solution for this? Any help would be much appreciated.