Matlab Error ...

Thread Starter

panic mode

Joined Oct 10, 2011
2,749
got PM from m_arezoo

hi
i use your matlab code to read audio file but also it has an error, please help me

Rich (BB code):
[signal, Fs, bits_per_sample]=wavread('C:\Users\hp\Desktop\abc.wav');

L=length(signal); % file length
T=1/Fs; % sample period
t=[0:L-1]*T; % time vector in seconds

% define echo and amplitude values
Te=40; % set echo to 300 ms 
alpha = 0.9; % scale amplitude of echo
DelaySec = round(Te / 1000); % must be integer
te = round(DelaySec / T); % echo delay as integer (rel. to sample period)

signalplusecho=1:L+te; % declare it as vector before loop
for t = 1:L+te
if (t<te) 
signalplusecho(t)=signal(t);
elseif (t>=L) 
signalplusecho(t)=signal(t-te);
else 
signalplusecho(t)=signal(t) + alpha*signal(t+te);
end
end

wavwrite(signalplusecho,Fs,8, 'speechwithecho.wav');
??? Error using ==> wavread at 166
Invalid field name: ''.
Error in ==> read at 4
[signal, Fs, bits_per_sample]=wavread('C:\Users\hp\Desktop\abc.wav');
dear m_arezoo, please do not use PM for non-personal matter. I assure you that program is working fine on my machine.

do you understand what error tells you?

are you sure your user account on your pc is called HP and not m_arezoo or something similar?

C:\Users\hp\Desktop\abc.wav

are you sure that entire path and file name are correct?
 
Top