audioDeviceReader: error when choosing ASIO driver for input mic
Show older comments
Dear community,
I have an error when I want to choose the Device for the audio device reader interactively. Altough the String input is exactly the same, there is an error I cannot understand.
audiodevreset();
% get available audio device (using audiodevinfo() can deliver wrong strings)
tmp=audioDeviceReader();
devs=getAudioDevices(tmp);
% release and clear to avoid interactions with further code
release(tmp); clear tmp;
[indx,tf] = listdlg('PromptString',{'Select a input device.'},...
'SelectionMode','single','ListString',devs,'ListSize',[400 80]);
% return if canceled
if ~tf
return;
end
audioReader = audioDeviceReader('Driver','ASIO','NumChannels',1,'SampleRate',fs,'SamplesPerFrame',frameSize,'Device',devs{indx});
checking also directly in command line gives
>> audioDeviceReader('Device','External Mic (Realtek(R) Audio)')
ans =
audioDeviceReader with properties:
Driver: 'DirectSound'
Device: 'External Mic (Realtek(R) Audio)'
NumChannels: 1
SamplesPerFrame: 1024
SampleRate: 44100
Show all properties
devs{indx}
ans =
'External Mic (Realtek(R) Audio)'
The error is this:
Error using matlab.system.StringSet/findMatch
"External Mic (Realtek(R) Audio)" is not a valid value for the Device property. Valid values are: "Default" | "ASIO4ALL v2".
Error in audiointerface.audioDeviceReader
Error in audioDeviceReader
Error in streamingOnly (line 24)
audioReader = audioDeviceReader('Driver','ASIO','NumChannels',1,'SampleRate',fs,'SamplesPerFrame',frameSize,'Device',devs{indx});
the part with ASIO4ALL v2 sounds like there is a problem with the driver, but I dont know how to resolve. The line
audioDeviceReader('Device',devs{indx})
also works without throwing an error, but
audioDeviceReader('Device',devs{indx},'Driver','ASIO')
throws the same error. Am I not allowed to choose the ASIO Driver here? I had no problems with this line before switching from Win 10 to Win 11
Accepted Answer
More Answers (0)
Categories
Find more on Audio and Video Data in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!