function process_audio() load session_info.mat; % load chunk_info.mat path = 'features/'; wav_dir = 'wav/'; wav_ext = '.wav'; d = 0; for g=1:4 for s =1:12 files = []; person1 = [wav_dir session{1,s,g} wav_ext]; person2 = [wav_dir session{2,s,g} wav_ext]; person3 = [wav_dir session{3,s,g} wav_ext]; person4 = [wav_dir session{4,s,g} wav_ext]; count = 1; if (exist(person1)) files{count} = person1; count = count + 1; end if (exist(person2)) files{count} = person2; count = count + 1; end if (exist(person3)) files{count} = person3; count = count + 1; end if (exist(person4)) files{count} = person4; count = count + 1; end if (~isempty(files)) d = d+1 names{d} = files; sessions{d} = ['group_' num2str(g) '_session_' num2str(s)]; %orignal code to create features % features = speech_features_separate_files(files); % eval(['features_' num2str(g) '_' num2str(s) ' = features;']); % save([path 'features_' num2str(g) '_' num2str(s)],['features_' num2str(g) '_' num2str(s)]); load([path 'features_' num2str(g) '_' num2str(s)]); eval(['features = features_' num2str(g) '_' num2str(s) ';']); clear(['features_' num2str(g) '_' num2str(s)]); [states_voiced, states_speaking, voiced_all{d}] = voicing_speaking_sip(features, 'threshold', 0.10); all_states_voiced{d} = states_voiced; all_states_speaking{d} = states_speaking; [one_min_means{d}, one_min_stds{d}, one_min_others{d}] = chunk_features(features, all_states_voiced{d}, all_states_speaking{d},1); one_min_alphas{d} = chunk_influence(states_speaking,1); [total_means{d}, total_stds{d}, total_others{d}] = chunk_features(features, all_states_voiced{d}, all_states_speaking{d},inf); total_alphas{d} = chunk_influence(states_speaking,inf); save('audio_features','one_min*','total*','all_states_speaking','all_states_voiced','names','sessions','voiced_all'); end end end