problems with matlab wavrecord and wavread
- by user504363
Hi all
I have a problem in matlab
I want to record a speech for 2 seconds then read the recorded sound and plot it
I use the code
FS = 8000;
new_wav = wavrecord(2*FS,FS,'int16');
x = wavread(new_wav);
plot(x);
but the error appears
??? Error using ==> fileparts at 20
Input must be a row vector of characters.
Error in ==> wavread>open_wav at 193
[pat,nam,ext] = fileparts(file);
Error in ==> wavread at 65
[fid,msg] = open_wav(file);
Error in ==> test at 2
x = wavread(new_wav);
I plotted correctly recorded sound files, but when I want to record new one through matlab I get this errors.
I tried many ways by changing FS and 'int16' but nothing happens.
thanks