Error while evaluating uicontrol Callback

2 views (last 30 days)
luna dam
luna dam on 9 May 2015
here is the code where i have the error
function karaoke_btn_Callback(hObject, eventdata, handles)
% hObject handle to karaoke_btn (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
set(handles.path_txt,'Enable','off');
set(handles.input_btn,'Enable','off');
set(handles.out_txt,'Enable','off');
set(handles.output_btn,'Enable','off');
set(handles.fc_slider,'Enable','off');
set(handles.hpcut_txt,'Enable','off');
file = get(handles.input_txt,'String');
try
[y,Fs,nbits]= wavread(file);
catch
msgbox('Invalid File');
set(handles.path_txt,'Enable','on');
set(handles.input_btn,'Enable','on');
set(handles.out_txt,'Enable','on');
set(handles.output_btn,'Enable','on');
set(handles.fc_slider,'Enable','on');
set(handles.hpcut_txt,'Enable','on');
return;
end
%Remove Voice and save the file
left=y(:,1);
right=y(:,2);
karaoke_wav= wavwrite(left-right, fs,'ramright.wav');
%%%%%%%%%%%%%%%%%%
[p name ext] = fileparts(file);
dir = get(handles.out_txt,'String');
if isdir(dir)
wavwrite(karaoke_wav,Fs,nbits,[dir '\' name ext]);
else
wavwrite(karaoke_wav,Fs,nbits,[cd '\' name ext]);
end

Answers (0)

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!