When i try to open a wav file, i got this error:
Error using wavread (line 67)
Invalid Wave File. Reason: Cannot open file.
Error in gui>Open_Callback (line 125)
[mySong,sf]=wavread(myFile);
Error in gui_mainfcn (line 96)
feval(varargin{:});
Error in gui (line 42)
gui_mainfcn(gui_State, varargin{:});
Error in
@(hObject,eventdata)gui('Open_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating uimenu Callback
my code:
function Open_Callback(hObject, eventdata, handles)
global pl;
global sf;
[FileName,PathName]=uigetfile('*.wav');
myFile=[FileName,PathName];
[mySong,sf]=wavread(myFile);
[M N] = size(mySong);
i=1:1:M;
axes(handles.axes1);
axis([1 M min(mySong) max(mySong)]);
plot(i,mySong);
pl=auidoplayer(mySong,sf);

댓글 수: 1

zaYy Nab
zaYy Nab 2017년 5월 9일
Invalid wave file error (line 67)occur because matlab supports specific format of audio file i-e PCM . first convert your audio from mp3 to pcm then place into current directory and run the program

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

 채택된 답변

ChristianW
ChristianW 2013년 3월 14일

0 개 추천

myFile=[PathName,FileName];

댓글 수: 4

The
The 2013년 3월 15일
i open the file but still it gives error. i try with 3 different wav files. each gives different errors.
one of them:
Undefined function 'auidoplayer' for input arguments of type 'double'.
Error in gui>Open_Callback (line 131) pl=auidoplayer(mySong,sf);
other:
Error using set Bad property value found. Object Name : axes Property Name : 'YLim' Values must be increasing and non-NaN.
Error in axis>LocSetLimits (line 208) set(ax,...
Error in axis (line 94) LocSetLimits(ax(j),cur_arg);
Error in gui>Open_Callback (line 129) axis([1 M min(mySong) max(mySong)]);
other:
Error using wavread (line 164) Invalid Wave File. Reason: Data compression format (Format #85) is not supported.
Error in gui>Open_Callback (line 125) [mySong,sf]=wavread(myFile);
The
The 2013년 3월 17일
I tried 2 different wav files. They give this error:
Undefined function 'auidoplayer' for input arguments of type 'double'.
Error in gui>Open_Callback (line 131) pl=auidoplayer(mySong,sf);
Image Analyst
Image Analyst 2013년 3월 17일
I thought this was marked as solved. Maybe you want audioplayer instead of auidoplayer.

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

추가 답변 (2개)

Youssef  Khmou
Youssef Khmou 2013년 3월 14일

0 개 추천

hi, take that file into directory ...\Documents\MATLAB :
Image Analyst
Image Analyst 2013년 3월 14일

0 개 추천

You didn't construct the full filename properly. Use the fullfile() function:
fullFileName = fullfile(PathName, FileName);
[mySong, sf] = wavread(fullFileName);

카테고리

도움말 센터File Exchange에서 Audio I/O and Waveform Generation에 대해 자세히 알아보기

태그

질문:

The
2013년 3월 14일

댓글:

2017년 5월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by