% vowel_id - script for vowel identification experiment % plays back a randomized list of stimuli % Allowable responses are the 11 vowels % 11 vowels * 1 male (CR) +1 female(DL) talker = 22 vowels x ?? conditions % Allowable responses are the 11 vowels: %------------------------------------------------- % heed ii [i] % hid il [I] % hayed ee [e] % head el [E] % had al [ae] % hud uh [^] % herd er [3] % hod aa [a] % hoed oo [o] % hood ul [U] % who'd uu [u] clear all; close all; more off; % subj=input('Enter subject initials: ', 's'); subj='pa'; if exist(subj,'file'), deleteflag=input(['File ' subj ' already exists. Replace (y/n)? >> '],'s'); if ~strcmp(deleteflag,'y'), return; end; elseif exist([subj '.mat'],'file'), deleteflag=input(['File ' subj ' already exists. Replace (y/n)? >> '],'s'); if ~strcmp(deleteflag,'y'), return; end; end; clc; cond='Vowel_ID'; dt=date; nconditions=1; nvow=33; nfiles=nvow.*nconditions; PATH=cd; files=dir([PATH '\*.wav']); files=char(files.name); [nfiles,nchar]=size(files); randlist=randperm(nfiles); stimlist=files(randlist,:); resplist=zeros(nfiles,2); hvd=str2mat('heed','hid','hayed','head','had','hud','hod','herd','hoed','hood','whod'); vow=str2mat('ii','il','ee','el','al','uh','aa','er','oo','ul','uu'); keyword=str2mat('weed','did','made','bed','dad','flood','cod','bird','toad','wood','rude'); figure(1); POS=get(0,'ScreenSize'); i=1; xl=[0.05+(0:5)*.15 0.05+(0:4)*.15+0.075]; yl=[0.6 0.6 0.6 0.6 0.6 0.6 0.3 0.3 0.3 0.3 0.3]; for ivow=1:11, set(1,'resize','On','numbertitle','Off',... 'windowstyle','normal',... 'Pos',POS); eval(['str=''r=' int2str(ivow) ';set(gcf,''''userdata'''',1)'';']); h(ivow)=uicontrol('Style','pushbutton',... 'Units','Norm',... 'Pos',[xl(ivow) yl(ivow) 0.145 0.2],... 'FontSize',18,... 'FontName','Arial',... 'String',hvd(ivow,:),... 'Callback',str); h1a(ivow)=uicontrol('Style','text',... 'Units','Norm',... 'Pos',[xl(ivow) yl(ivow)-0.04 0.14 0.035],... 'FontName','Arial',... 'FontSize',14,... 'String',keyword(ivow,:)); end; hh1=uicontrol('Style','text',... 'Units','Norm',... 'Pos',[0.25 0.15 0.5 0.07],... 'String','To enter response click inside box',... 'FontSize',15); hh2=uicontrol('Style','Pushbutton',... 'Units','Norm',... 'Pos',[0.25 0.85 0.5 0.07],... 'String','Click here when ready to start',... 'Callback','delete(hh2)',... 'FontSize',15); drawnow; waitfor(hh2); for i=1:nfiles, pause(1); set(hh1,'String',... ['Stimulus ' int2str(i) ' of ' int2str(nfiles)]); % eval(['!C:\WINDOWS\SNDREC32.EXE /play /close ' stimlist(i,:)]); % eval(['!C:\WINDOWS\SYSTEM32\SNDREC32.EXE /play /close ' stimlist(i,:)]); [y,rate]=wavread(deblank(stimlist(i,:))); sound(y/10,rate); figure(1); waitfor(1,'UserData'); set(1,'userdata',rand); resplist(i,1:2)=char(vow(r,:)); eval(['save ' subj]); end; eval(['save ' subj ' stimlist resplist randlist files cond dt']); close all; hh2=uicontrol('Style','text',... 'Units','Norm',... 'Pos',[0.1 0.7 0.8 0.2],... 'HorizontalAlignment','center',... 'String','Finished!',... 'Callback','close all;',... 'FontSize',48); clc;