MATLAB: Error using audioread function in MATLAB. It gives error while using .wav or .mp3.

audioread

>> [y,Fs] = audioread('C:\Users\sat33\Documents\MATLAB\audio1.wav')
*** audioread: problem reading C:\Users\sat33\Documents\MATLAB\audio1.wav - returning empty waveform
y =
[]
Fs =
0

Best Answer

Hello Satwik,
This error might be the result of a third-party "audioread" function available on the internet, which is possibly shadowing the built-in MATLAB "audioread" function.
Verify you are using the built-in “audioread” function by executing the following line in the MATLAB Command Window:
>> which('audioread', '-all')
The only path displayed should be:
matlabroot\toolbox\matlab\audiovideo\audioread.m
Note that "matlabroot" in the path shown above will be replaced by the path of the folder where MATLAB is installed in your system.
If more than one path is displayed, a third-party function is taking precedence over the built-in "audioread" function.
If you want to return to using the built-in function, you must remove the third-party function from your MATLAB search path by executing the following lines in the Command Window:
>> rmpath(fileparts(which('audioread')))
>> savepath