フィルターのクリア

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.
Geoff Hayes
Geoff Hayes 2018 年 6 月 6 日
glad that it worked, Hoda!

サインインしてコメントする。

回答 (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 Center および File ExchangeMultirate Signal Processing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by