function mirAudioComp
% Funkce pro vypocet miraudio souboru z nahravek
% Stepan Miklanek, 2018

DBpath = uigetdir;
DBinfo = dir(DBpath);
filenames = extractfield(DBinfo(3:end),'name');

nAudio = length(filenames);
mkdir(DBpath,'mirAudioFiles');

for n = 1:nAudio
        
    currentFile = filenames{n};  
    filename = [DBpath,'\',currentFile];
    [~,name,~] = fileparts(filename);

    a = miraudio(filename,'Sampling',44100,'Mono',1);
       
    savepath = [DBpath,'\','mirAudioFiles','\',name,'.mat'];
    save(savepath,'a')
    
end

end

