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)

조회 수: 3 (최근 30일)
[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 ???

채택된 답변

Walter Roberson
Walter Roberson 2015년 7월 22일
편집: Walter Roberson 2015년 7월 22일
[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.
  댓글 수: 1
lione felus
lione felus 2015년 7월 22일
편집: lione felus 2015년 7월 22일
thanks walter it works .but by appling filter the sound is still not audible .my code is PathOriginal = fullfile('C:\Users\Documents\MATLAB', 'AUD-20150716-WA0032.wav') [y, Fs, n] = wavread(PathOriginal)
b=1; a=0.1; a=[1 -0.1];
x(n)=y(n)-0.1*y(n-1); y=filter(b,a,x)
what command should i use to hear the sound before and after applying filter??

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

B.k Sumedha
B.k Sumedha 2015년 7월 22일
You can directly use
y = wavread('filename')
y = wavread('filename') loads a WAVE file specified by the string filename, returning the sampled data in y. The .wav extension is appended if no extension is given. Amplitude values are in the range [-1,+1].

카테고리

Help CenterFile Exchange에서 Audio I/O and Waveform Generation에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by