Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

getAudioDevices

List available audio devices

Syntax

devices = getAudioDevices(obj)

Description

example

devices = getAudioDevices(obj) returns a list of audio devices that are available and compatible with your audio I/O object, obj.

Examples

collapse all

Create an audioDeviceReader System object™, and then call getAudioDevices on your object.

deviceReader = audioDeviceReader;
devices = getAudioDevices(deviceReader)
devices =

  1x4 cell array

    {'Default'}    {'Turtle Beach U...'}    {'pulse'}    {'ALSAdefault'}

Create an audioDeviceWriter System object™, and then call getAudioDevices on your object.

deviceWriter = audioDeviceWriter;
devices = getAudioDevices(deviceWriter)
devices =

  1x6 cell array

  Columns 1 through 4

    {'Default'}    {'HDA ATI HDMI: ...'}    {'Turtle Beach U...'}    {'hdmi'}

  Columns 5 through 6

    {'pulse'}    {'ALSAdefault'}

Create an audioPlayerRecorder System object™, and then call getAudioDevices on your object.

playRec = audioPlayerRecorder;
devices = getAudioDevices(playRec)
devices =

  1x4 cell array

    {'Default'}    {'Turtle Beach U...'}    {'pulse'}    {'ALSAdefault'}

Input Arguments

collapse all

Audio I/O object, specified as an object of audioDeviceReader, audioDeviceWriter, or audioPlayerRecorder.

Data Types: object

Output Arguments

collapse all

List of available and compatible devices.

For audioDeviceReader and audioDeviceWriter, the list of audio devices depends on the specified Driver property of your object.

For audioPlayerRecorder, the audio devices listed support full-duplex mode and have a platform-appropriate driver:

  • Windows® –– ASIO™

  • Mac –– CoreAudio

  • Linux® –– ALSA

Data Types: cell

Introduced in R2016a

Was this topic helpful?