Borrar filtros
Borrar filtros

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

3 visualizaciones (últimos 30 días)
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 comentarios
hoda kazemzadeh
hoda kazemzadeh el 6 de Jun. de 2018
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.

Iniciar sesión para comentar.

Respuestas (1)

Geoff Hayes
Geoff Hayes el 6 de Jun. de 2018
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,);

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by