List available audio devices
Devices are persistent within a MATLAB® session. To recognize new devices within your MATLAB session, clear device
data within your session using the command line. As an example, if you have created an
audioDeviceReader
System
object™, you can type the following
into your command line:
>> deviceReader = audioDeviceReader; >> devices = getAudioDevices(deviceReader)
devices = 1×1 cell array {'No audio input device detected'}
This displays a list of the devices connected to your computer. To add more devices, connect the additional devices to your computer. Then, type the following into your command line:
>> clear deviceReader dspAudioDeviceInfo
>> deviceReader = audioDeviceReader;
>> devices = getAudioDevices(deviceReader)
devices = 1×3 cell array {'Default'} {'Primary Sound Capture Driver'} {'Headset Microphone (Plantro…'}
This displays an updated list of the devices connected to your computer, including the
devices you added during your current session. This process also works with the
audioDeviceWriter
and audioPlayerRecorder
System
objects.