Information about audio device
information about the input and output audio devices on the system.
info = audiodevinfo
the number of input devices on the system if
nDevices = audiodevinfo(
and returns the number of output devices on the system if
audiodevinfo with no inputs to
view information about the input and output audio devices on a system.
info = audiodevinfo
info = input: [1x2 struct] output: [1x3 struct]
audiodevinfo returns a structure containing
View the contents of the
in the Variables editor.
The Variables editor displays the input audio device names, driver used, and device identifiers. The values on your system might differ from this example.
View the number of output audio devices on the system,
IO value of
0 to indicate
nDevices = audiodevinfo(0)
nDevices = 3
This example shows three output devices, but your system might vary.
Check if the input audio device identified
a sample rate of 44100 hertz, with 16 bits per sample, and two channels.
support = audiodevinfo(1,0,44100,16,2)
support = 1
The input device supports the specified sample rate, number of bits and number of channels.
Input or output device, specified as
indicate input, or
0 to indicate output.
ID— Audio device identifierinteger
Audio device identifier, specified as an integer. The device can be an input or output audio device.
Fs— Sample ratescalar
Sample rate, in hertz, specified as a positive scalar.
Number of bits per sample, specified as a scalar.
Number of audio channels, specified as
Name of the input or output audio device, specified as a string.
info— Information about audio devicesstructure array
Information about audio devices, returned as a structure array
containing two fields,
Each field is an array of structures, with each structure containing
information about one of the audio input or output devices on the
system. The individual device structure fields are:
Name — Name of the device,
returned as a string.
DriverVersion — Name of
the driver used to communicate with the device, returned as a string.
ID — Device identifier,
returned as a scalar.