Skip to content

Commit f134502

Browse files
committed
update load audiofiles
1 parent 6af57b9 commit f134502

File tree

1 file changed

+17
-33
lines changed

1 file changed

+17
-33
lines changed

subfun/loadAudioFiles.m

Lines changed: 17 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -12,57 +12,41 @@
1212
end
1313

1414
%% Load the sounds
15-
15+
1616
% static Stimuli
1717
fileName = fullfile('input', 'Static', 'Static.wav');
1818
[soundData.S, freq1] = audioread(fileName);
1919
soundData.S = soundData.S';
2020

2121
% motion input
22-
fileName = fullfile('input', 'Motion', subjName, ['rms_', subjName, '_U.wav']);
23-
[soundData.U, freq2] = audioread(fileName);
24-
soundData.U = soundData.U';
25-
26-
fileName = fullfile('input', 'Motion', subjName, ['rms_', subjName, '_D.wav']);
27-
[soundData.D, freq3] = audioread(fileName);
28-
soundData.D = soundData.D';
29-
30-
fileName = fullfile('input', 'Motion', subjName, ['rms_', subjName, '_R.wav']);
31-
[soundData.R, freq4] = audioread(fileName);
32-
soundData.R = soundData.R';
22+
fileName = fullfile('input', 'Motion', subjName, [ subjName, '_LRL_rms.wav']);
23+
[soundData.LRL, freq2] = audioread(fileName);
24+
soundData.LRL = soundData.LRL';
3325

34-
fileName = fullfile('input', 'Motion', subjName, ['rms_', subjName, '_L.wav']);
35-
[soundData.L, freq5] = audioread(fileName);
36-
soundData.L = soundData.L';
26+
fileName = fullfile('input', 'Motion', subjName, [ subjName, '_RLR_rms.wav']);
27+
[soundData.RLR, freq3] = audioread(fileName);
28+
soundData.RLR = soundData.RLR';
3729

3830
%% Targets
3931

4032
% static Stimuli
4133
fileName = fullfile('input', 'Static', 'Static_T.wav');
42-
[soundData.S_T, freq6] = audioread(fileName);
34+
[soundData.S_T, freq4] = audioread(fileName);
4335
soundData.S_T = soundData.S_T';
4436

4537
% motion Stimuli
46-
fileName = fullfile('input', 'Motion', subjName, ['rms_', subjName, '_U_T.wav']);
47-
[soundData.U_T, freq7] = audioread(fileName);
48-
soundData.U_T = soundData.U_T';
49-
50-
fileName = fullfile('input', 'Motion', subjName, ['rms_', subjName, '_D_T.wav']);
51-
[soundData.D_T, freq8] = audioread(fileName);
52-
soundData.D_T = soundData.D_T';
53-
54-
fileName = fullfile('input', 'Motion', subjName, ['rms_', subjName, '_R_T.wav']);
55-
[soundData.R_T, freq9] = audioread(fileName);
56-
soundData.R_T = soundData.R_T';
38+
fileName = fullfile('input', 'Motion', subjName, [ subjName, '_LRL_T_rms.wav']);
39+
[soundData.LRL_T, freq5] = audioread(fileName);
40+
soundData.LRL_T = soundData.LRL_T';
5741

58-
fileName = fullfile('input', 'Motion', subjName, ['rms_', subjName, '_L_T.wav']);
59-
[soundData.L_T, freq10] = audioread(fileName);
60-
soundData.L_T = soundData.L_T';
42+
fileName = fullfile('input', 'Motion', subjName, [ subjName, '_RLR_T_rms.wav']);
43+
[soundData.RLR_T, freq6] = audioread(fileName);
44+
soundData.RLR_T = soundData.RLR_T';
6145

62-
if length(unique([freq1 freq2 freq3 freq4 freq5 freq6 freq7 freq8 freq9 freq10])) > 1
63-
error ('Sounds dont have the same frequency');
46+
if length(unique([ freq1 freq2 freq3 freq4 freq5 freq6 ])) > 1
47+
error ('Sounds do not have the same frequency');
6448
else
65-
freq = unique([freq1 freq2 freq3 freq4 freq5 freq6 freq7 freq8 freq9 freq10]);
49+
freq = unique([ freq1 freq2 freq3 freq4 freq5 freq6 ]);
6650
end
6751

6852
cfg.soundData = soundData;

0 commit comments

Comments
 (0)