"audioDeviceReader" not accepting device input from list of audio devices

조회 수: 9 (최근 30일)
Background
I have multiple audio devices connected to my computer which are visible when I run the following code (output included):
deviceReader = audioDeviceReader;
devices = getAudioDevices(deviceReader).'
devices = 5×1 cell
'Default'
'Primary Sound Capture Driver'
'Line (2- MCHStreamer Multi-channels)'
'Line (MCHStreamer Multi-channels)'
'Microphone Array on SoundWire Device (2- Cirrus Logic XU)'
Problem
Using this list of available devices for audioDeviceReader, I try and select a given device (e.g., 'Line (MCHStreamer Multi-channels)') when initializing audioDeviceReader():
deviceReader = audioDeviceReader(Driver="ASIO", ...
Device="Line (MCHStreamer Multi-channels)")
and I get the following error:
Interestingly enough, the two listed valid values correspond to getAudioDevices(obj) output to audioPlayerRecorder:
playRec = audioPlayerRecorder;
playRec_devices = getAudioDevices(playRec).'
playRec_devices = 2×1 cell
'Default'
'miniDSP ASIO Driver'
Question
How do I fix this? I want audioDeviceReader to call a particular device---which it clearly sees---yet I'm only given choices that correspond to audioPlayerRecorder---a completely different (but related) class.
  댓글 수: 2
Anay
Anay 2025년 8월 20일
편집: Anay 2025년 8월 20일
Hi tsf44,
Have you confirmed if the device you want to use is a ASIO device? To display the ASIO device names, specify that as the driver:
deviceReader = audioDeviceReader(Driver="ASIO");
devices = getAudioDevices(deviceReader);
tsf44
tsf44 2025년 8월 20일
I ran your code and sure enough, when I include the Driver='ASIO' name-value pair, the list of available devices does not include the other devices, so that answers that question.
Is there another way I could call an individual input other than audioDeviceReader? I tried also using audiorecorder() by specifying the respective device ID, but unfortunately that method is limited to recording only two channels when I'm using a device that has 16 input channels.

댓글을 달려면 로그인하십시오.

채택된 답변

Jimmy Lapierre
Jimmy Lapierre 2025년 8월 21일
The default audioDeviceReader object is constructed with Driver='DirectSound', so getAudioDevices will return audio devices that are available with DirectSound.
As Anay said, you can list ASIO devices by changing the Driver property first:
deviceReader = audioDeviceReader(Driver="ASIO");
devices = getAudioDevices(deviceReader);
Starting from R2025a, there is also a new audiostreamer object that might be of interest for you. It can list all devices for all drivers. It provides more information, such as the default (prefered) sample rate of each device. This object has a static method getAudioDevices.
>> deviceTable = struct2table(audiostreamer.getAudioDevices)
deviceTable =
28×5 table
Name Driver MaxRecorderChannels MaxPlayerChannels SampleRate
____________________________________ _____________ ___________________ _________________ __________
"Primary Sound Capture Driver" "DirectSound" 2 0 44100
"Analog (1-8) (RME UFX+ USB 3.0)" "DirectSound" 8 0 44100
"Microphone (Logitech Webcam C925e)" "DirectSound" 2 0 44100
"Headset Microphone (Poly BT700)" "DirectSound" 1 0 44100
: : : : :

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Multichannel Audio Input and Output에 대해 자세히 알아보기

제품


릴리스

R2025a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by