audioDeviceReader: error when choosing ASIO driver for input mic
6 views (last 30 days)
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
0 Comments
Answers (1)
Manoj Mirge
on 24 Mar 2023
Hi Jonas,
You can get the list of audio devices which are compatible with specific driver by using getAudioDevices function.
tmp=audioDeviceReader("Driver","ASIO");
% Specify driver name in audioDeviceReader’s Driver field.
devices=getAudioDevices(tmp)
% devices will contain cell array of compatible devices with the specific driver in this %case devices compatible with ASIO driver.
You can run above code and check whether 'External Mic (Realtek(R) Audio)' device is included in devices list or not. If your device is not there in that list then you can’t choose that device with that driver. As that device is not compatible with that driver.
Note:
tmp=audioDeviceReader() creates “audioDeviceReader” object with default driver as DirectSound driver as Directsound is default driver used if no driver argument is provided to “audioDeviceReader” function.
By running below code:
tmp=audioDeviceReader();
devices=getAudioDevices(tmp);
devices will contain list of devices compatible with DirectSound driver. To get list of devices compatible with ASIO driver provide explicit driver name to audioDeviceReader function.
If you are still facing issue to connect to ASIO driver, you can try to update ASIO driver.
Hope this helps.
Please accept this answer if this resolves your issue.
0 Comments
See Also
Categories
Find more on Simulation, Tuning, and Visualization 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!