|
| 1 | +function [soundData, freq] = loadAudioFiles(SubjName) |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | +%static Stimuli |
| 6 | +fileName=fullfile('stimuli','Static','Static.wav'); |
| 7 | +[soundData.S , freq1] = audioread(fileName); |
| 8 | +soundData.S = soundData.S'; |
| 9 | + |
| 10 | +%motion Stimuli |
| 11 | +fileName=fullfile('stimuli','Motion',SubjName,['rms_',SubjName,'_U.wav']); |
| 12 | +[soundData.U , freq2] = audioread(fileName); |
| 13 | +soundData.U = soundData.U'; |
| 14 | + |
| 15 | +fileName=fullfile('stimuli','Motion',SubjName,['rms_',SubjName,'_D.wav']); |
| 16 | +[soundData.D , freq3] = audioread(fileName); |
| 17 | +soundData.D = soundData.D'; |
| 18 | + |
| 19 | +fileName=fullfile('stimuli','Motion',SubjName,['rms_',SubjName,'_R.wav']); |
| 20 | +[soundData.R , freq4] = audioread(fileName); |
| 21 | +soundData.R = soundData.R'; |
| 22 | + |
| 23 | + |
| 24 | +fileName=fullfile('stimuli','Motion',SubjName,['rms_',SubjName,'_L.wav']); |
| 25 | +[soundData.L , freq5] = audioread(fileName); |
| 26 | +soundData.L = soundData.L'; |
| 27 | + |
| 28 | + |
| 29 | +%% Targets |
| 30 | + |
| 31 | +%static Stimuli |
| 32 | +fileName=fullfile('stimuli','Static','Static_T.wav'); |
| 33 | +[soundData.S_T , freq6] = audioread(fileName); |
| 34 | +soundData.S_T = soundData.S_T'; |
| 35 | + |
| 36 | +%motion Stimuli |
| 37 | +fileName=fullfile('stimuli','Motion',SubjName,['rms_',SubjName,'_U_T.wav']); |
| 38 | +[soundData.U_T , freq7] = audioread(fileName); |
| 39 | +soundData.U_T = soundData.U_T'; |
| 40 | + |
| 41 | +fileName=fullfile('stimuli','Motion',SubjName,['rms_',SubjName,'_D_T.wav']); |
| 42 | +[soundData.D_T , freq8] = audioread(fileName); |
| 43 | +soundData.D_T = soundData.D_T'; |
| 44 | + |
| 45 | +fileName=fullfile('stimuli','Motion',SubjName,['rms_',SubjName,'_R_T.wav']); |
| 46 | +[soundData.R_T , freq9] = audioread(fileName); |
| 47 | +soundData.R_T = soundData.R_T'; |
| 48 | + |
| 49 | + |
| 50 | +fileName=fullfile('stimuli','Motion',SubjName,['rms_',SubjName,'_L_T.wav']); |
| 51 | +[soundData.L_T , freq10] = audioread(fileName); |
| 52 | +soundData.L_T = soundData.L_T'; |
| 53 | + |
| 54 | + |
| 55 | +if length(unique([freq1 freq2 freq3 freq4 freq5 freq6 freq7 freq8 freq9 freq10]))>1 |
| 56 | + error ('Sounds dont have the same frequency') |
| 57 | +else |
| 58 | + freq = unique([freq1 freq2 freq3 freq4 freq5 freq6 freq7 freq8 freq9 freq10]); |
| 59 | +end |
0 commit comments