function dopOSCCIalert(label)
% dopOSCCI Mark II: dopOSCCIallert ~ 29-10-2010 (last edit)
%
% plays a wav file to alert user about:
% - crash/caught variable
% - finish of summary
%
% dopOSCCIalert(label)
% - where label = 'Caught' or 'Finish'
%
% calls wav file from ...\dopTools\genTools\
%

%% play sound
% to announce the crash/caught variable and finish
try
    % get the location of the dopOSCCI function - should be on matlab path
    dfl=which('dopOSCCI'); % dopOSCCI file location
    dl=fileparts(dfl); % dopOSCCI location
    
    % play sound...
    snl=[dl,'\dopTools\genTools\sound',label,'.wav']; % sound name location
    if exist(snl,'file')
        [Y,FS]=wavread(snl);
        wavplay(Y,FS,'async');
    end
catch err
    %% catch dopOSCCI error
    % 
save(dopOSCCIdebug(mfilename));throw(err); 
end

clear dfl dl snl Y FS