필터 지우기
필터 지우기

Start storing the recorded sound with pressing the button in real time

조회 수: 3 (최근 30일)
hoda kazemzadeh
hoda kazemzadeh 2018년 6월 5일
댓글: Geoff Hayes 2018년 6월 6일
I record speech from the microphone, I use audiorecorder and a timer function fire every one second and doing some process (as FFT) the plot data captured in that last one second. I want to store FFT samples in a csv file when I push store button and stop storing when I push StopStore button. (for example I push store button in 4th second of recording and I push Stop button in 10th second, I want to save fft for 6 seconds (4s-10s) in csv file).
Could somebody help me how to do that. Thanks
  댓글 수: 10
hoda kazemzadeh
hoda kazemzadeh 2018년 6월 6일
Geoff- Yes the handles.samples is the array of all collected data from the beginning of recording. I try what you proposed and working perfect! I did the same for storing FFT data in the same way and is working well. Thank you very musch.

댓글을 달려면 로그인하십시오.

답변 (1개)

Geoff Hayes
Geoff Hayes 2018년 6월 6일
hoda - since handles.samples is an array of all collected samples (since starting the audio recorder), then when you press the store button (to start storing the data), just keep track of the number of samples that have been collected so far
function store_Callback(hObject, ~, handles)
handles.storeStartIdx = length(handles.samples);
guidata(hObject, handles);
Then in your stop (storing) button callback, you would create the file
function stopStore_Callback(hObject, ~, handles)
T=strrep(datestr(now),':','-');
filename=['record''-',T,'.wav'];
audiowrite(filename,handles.samples(handles. storeStartIdx:end),handles.FS,);

카테고리

Help CenterFile Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by