How do I properly update this code.
4 views (last 30 days)
Show older comments
How can I make this line of code that functioned properly in Matlab 2012 operate correctly in Matlab 2015b?
time = get(handles.time_slider,'Value');
x = wavrecord(time*8000,8000);
set(handles.gender,'String','See the estimated gender here');
set(handles.Fx1,'String', 'Fundamental Frequency');
The full code is attached.
2 Comments
Steven Lord
on 29 Nov 2015
How does this code not "operate correctly" in release R2015b? Does it throw an error (and if so what is the FULL text of the error message), does it issue a warning (and post the full text of the warning), etc?
Image Analyst
on 29 Nov 2015
>> gui_speech_analysis
Undefined function or variable 'wavrecord'.
Error in gui_speech_analysis>pushbutton_record_Callback (line 113)
x = wavrecord(time*8000,8000);
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in gui_speech_analysis (line 42)
gui_mainfcn(gui_State, varargin{:});
Error in
matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)gui_speech_analysis('pushbutton_record_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating UIControl Callback
Answers (1)
Walter Roberson
on 29 Nov 2015
function pushbutton_record_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton_record (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global x;
time = get(handles.time_slider,'Value');
recorder = audiorecorder(8000,8,1); %new
x = record(recorder, ceil(time*8000)); %changed
set(handles.gender,'String','See the estimated gender here');
set(handles.Fx1,'String', 'Fundamental Frequency');
guidata(hObject, handles);
2 Comments
Walter Roberson
on 29 Nov 2015
Edited: Walter Roberson
on 29 Nov 2015
function pushbutton_record_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton_record (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global x;
time = get(handles.time_slider,'Value');
recorder = audiorecorder(8000,8,1);
recordblocking(recorder, ceil(time*8000));
x = getaudiodata(recorder);
set(handles.gender,'String','See the estimated gender here');
set(handles.Fx1,'String', 'Fundamental Frequency');
guidata(hObject, handles);
See Also
Categories
Find more on Entering Commands 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!