how to use the pushbutton in GUI to record the voice
조회 수: 2 (최근 30일)
이전 댓글 표시
hello , I was trying to apply GUI with guide to my code voice recognition I actually dont know a lot about GUI .first, what I want to do is to assgin a push button for recording , how can I do that? I know how to make the figure but I dont know how to proceed after that starting from the option view callbacks ,here is a simple code as a start ,
rec1 = audiorecorder(22050, 16, 2);
disp('Start speaking.')
recordblocking(rec1, 2);
disp('End of Recording.');
any advice would be appreciated .
댓글 수: 3
Jan
2014년 4월 27일
@enas: "Didn't work" does not allow us to recognize, what is happening. Please spend the time to explain any details. Show us your code and explain the problems.
채택된 답변
Roberto
2014년 4월 27일
편집: Roberto
2014년 4월 27일
% Create the Audio recorder Object
>> rec = audiorecorder(22050, 16, 2);
% Create a Function to create the GUI
function test(rec)
f= figure ;
uicontrol(f,'style','pushbutton','position',[10 10 200 20],'String','Record','CallBack',@buttonCallback) ;
function buttonCallback(~,~)
disp('Recording... start talking');
rec.recordblocking(2);
disp('Stopped.');
end
end
% Execute the function with the object as a parameter
>> test(rec)
댓글 수: 2
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Audio and Video Data에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!