MATLAB: Sound audio playing and recording simultaneously
daqsound
Is it necessary to use DAQ toolbox to realize simultaneous audio playing and recording via sound card? Can audioplayer and audiorecorder objects achieve that?
Best Answer
It is necessary to use either DAQ or DSP to get simultaneous audio playing and recording if you want the two to be synchronized.
If you do not care about the two being synchronized, the audioplayer() play() method is asynchronous, and the audiorecorder() record() method is also asynchronous, so you can start one and then the other while still being able to react to user events.
You do not need to use a timer for this. You can use audioplayer() with either play() or playblocking(). audioplayer objects have a StopFcn callback that fires at the end of the audio.
Best Answer