code for simultaneous sound recording and playing
이전 댓글 표시
I have been using MATLAB for processing sound file. i used these two codes for reading sound file from mic. But in both codes i can only process or rather plot the sound file only after it completes recording.
rec1 = audiorecorder;
recordblocking(rec1, 15);
play(rec1);
and the second one is
AI = analoginput('winsound');
>> addchannel(AI, 1);
>>fs=11000
>> set (AI, 'SampleRate', fs)
>> t=10
>> set(AI, 'SamplesPerTrigger', t*fs);
>> start(AI);
>> data = getdata(AI);
but i need to plot the sound file while it is getting recorded. so someone please give me the modified code or some suggestion for that.
답변 (2개)
Walter Roberson
2011년 11월 30일
0 개 추천
Reduce your SamplesPerTrigger and loop on the getdata()
Sean de Wolski
2011년 11월 30일
I would highly recommend reading and browsing through some of the demos in the DAQ toolbox.
demo toolbox 'data acquisition'
카테고리
도움말 센터 및 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!