GUI to record , stop, playback sound

  • Follow


Hi all, 
I am new to MATLAB GUI... please advise how should i get things starts :(
I have tried to work out the thing but no result till now..

I am trying to work out a GUI that have three button
Record :  To initiate the recording
Stop: To stop the recording
Playback: To play back the recording

I am refering this Matlab page for play back .m code...
http://www.mathworks.com/help/techdoc/ref/audiorecorder.record.html

Then i created a .fig with 3 buttons.. then i tried to intergertae the code for record-stop-playback in the .fiig file... but i can work it out.... 

Please show me the steps how should i get the things correct... 
Very appreciate for your guide... 

*--------------------------------------------------------------------------------------------------------*
Below is the stupid attempt i did before:


% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
myVoice = audiorecorder;
record(myVoice);


% --- 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)
stop;

% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton3 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
play(myVoice);
0
Reply st 1/11/2011 4:03:05 AM

"st " <cell_st@hotmail.com> wrote in message <iggkpp$j2d$1@fred.mathworks.com>...
> Hi all, 
> I am new to MATLAB GUI... please advise how should i get things starts :(
> I have tried to work out the thing but no result till now..
> 
> I am trying to work out a GUI that have three button
> Record :  To initiate the recording
> Stop: To stop the recording
> Playback: To play back the recording
> 
> I am refering this Matlab page for play back .m code...
> http://www.mathworks.com/help/techdoc/ref/audiorecorder.record.html
> 
> Then i created a .fig with 3 buttons.. then i tried to intergertae the code for record-stop-playback in the .fiig file... but i can work it out.... 
> 
> Please show me the steps how should i get the things correct... 
> Very appreciate for your guide... 
> 
> *--------------------------------------------------------------------------------------------------------*
> Below is the stupid attempt i did before:
> 
> 
> % --- Executes on button press in pushbutton1.
> function pushbutton1_Callback(hObject, eventdata, handles)
> % hObject    handle to pushbutton1 (see GCBO)
> % eventdata  reserved - to be defined in a future version of MATLAB
> % handles    structure with handles and user data (see GUIDATA)
> myVoice = audiorecorder;
> record(myVoice);
> 
> 
> % --- 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)
> stop;
> 
> % --- Executes on button press in pushbutton3.
> function pushbutton3_Callback(hObject, eventdata, handles)
> % hObject    handle to pushbutton3 (see GCBO)
> % eventdata  reserved - to be defined in a future version of MATLAB
> % handles    structure with handles and user data (see GUIDATA)
> play(myVoice);


You have to save and retrieve your recorder using GUI data. More to look for here:
http://www.mathworks.com/help/techdoc/ref/guidata.html
0
Reply Thang 1/17/2011 10:11:05 PM


1 Replies
1137 Views

(page loaded in 0.028 seconds)

Similiar Articles:













7/19/2012 4:59:10 PM


Reply: