MATLAB: I am trying to read the .wav file through “wavread” giving path of wave using following code but it always give error 67(i-e ??? Error using ==> wavread at 67 Cannot open file)

error67MATLAB CompilerMATLAB Parallel ServerMATLAB Production ServerMATLAB Report Generatorwavread

[FileName,PathName] = uigetfile('AUD-20150716-WA0032.wav');
PathOriginal=sprintf('%s%s',C:\Users\Downloads,AUD-20150716-WA0032);
[xt,fs]=wavread('C:\Users\Downloads');
please help anyone ???

Best Answer

[FileName,PathName] = uigetfile('AUD-20150716-WA0032.wav');
PathOriginal = fullfile(PathName, FileName);
[xt,fs] = wavread(PathOriginal);
Or, along the lines that B.k Sumedha suggests:
PathOriginal = fullfile('C:\Users\Downloads', 'AUD-20150716-WA0032.wav');
[xt, fs] = wavread(PathOriginal);
The difference between these two is that the second one has a fixed file name, whereas the first one allows the users to navigate to other locations to pick a file.