I have come so far with my code, but no sound yet. What's next?
%User interface for audition of reference and comparison intervals
f = figure;
fp1 = uipanel('parent',f,'Title','Reference','fontSize',18,'Position',[.170 .50 .200 .200]);
fp2 = uipanel('parent',f,'Title','Comparison', 'fontSize',18,'Position',[.620 .50 .200 .200]);
[y1,Fs] = audioread('Reference_iem_test_0.wav');
[y2,Fs] = audioread('Variable_iem_test_4_0.wav');
pushbutton1 = uicontrol('Style','pushbutton','String','Play','Position',[90 100 50 50]);
pushbutton2 = uicontrol('Style','pushbutton','String','Stop','Position',[170 100 50 50]);
pushbutton3 = uicontrol('Style','pushbutton','String','Play','Position',[340 100 50 50]);
pushbutton4 = uicontrol('Style','pushbutton','String','Stop','Position',[420 100 50 50]);
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
global file_name;
if(~ischar(file_name))
else
if handles.status==0
handles.status=1;
[y1,Fs]=audioread(file_name);
handles.r=audioplayer1(y1,Fs);
play(handles.r);
else
warndlg({'Warning: Play Is Already In Progress.';' To Begin A New Play You Must First Stop The Current Session.'})
end
guidata(hObject,handles);
end
end
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
if handles.status==1
handles.status=0;
[y1,Fs]=audioread(file_name);
handles.r=audioplayer1(y1,Fs);
stop(handles.r);
else
errordlg('Warning: To Stop, Play Must Be In Progress.')
end
guidata(hObject,handles);
end
% --- Executes on button press in pushbutton1.
function pushbutton3_Callback(hObject, eventdata, handles)
global file_name;
if(~ischar(file_name))
else
if handles.status==0
handles.status=1;
[y2,Fs]=audioread(file_name);
handles.r=audioplayer2(y2,Fs);
play(handles.r);
end
guidata(hObject,handles);
end
end
% --- Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
if handles.status==1
handles.status=0;
[y2,Fs]=audioread(file_name);
handles.r=audioplayer2(y2,Fs);
stop(handles.r);
else
errordlg('Warning: To Stop, Play Must Be In Progress.')
end
guidata(hObject,handles);
end