function [signal, fs] = Load_signal(dirname,filename)

[path,name,ext] = fileparts(fullfile(dirname,filename));

switch ext
    case '.wav'
        [signal,fs] = wavread(strcat(dirname,filename));
    case '.WAV'
        [signal,fs] = readsph(strcat(dirname,filename),'*');
    case '.au'
        [signal,fs] = auread(strcat(dirname,filename));
    case '.snd'
        [signal,fs] = auread(strcat(dirname,filename));
    otherwise
        errordlg('loadsig: Signal file format is not one of .wav, .au or .snd', 'File Error');
        return;
end
if ~signal
    warndlg(['loadsig: Unable to load signal ' name]);
else
    signal = signal(:);
end