I keep getting this error: Error using i(line 13) Device Error: Unanticipated host error
38 views (last 30 days)
Fs=8000 ; bits=16; Channels=1;
recordblocking(rec,duration); %This is line 13, where the error is
%I'm trying to record an audio file and play it afterwards.
%How can I correct this error?
Anshika Chourasia on 23 Feb 2022
As a first step in troubleshooting this issue, I would suggest updating the software with latest release as it fixes most of the "Device Error" related issues. And, please make sure you restart MATLAB after plugging in any new devices because MATLAB does not automatically refresh the list of devices.
If the problem still persists then please share the output of the "audiodevinfo" command by saving it to a .MAT file. You can do this by entering the following commands at the command window:
>> info = audiodevinfo;
>> save('audioInfo.mat', 'info');
Ensure that the required device is present in the 'output' field of the struct.