主要内容

getAudioDevices

Available audio devices

Since R2025a

    Description

    devices = audiostreamer.getAudioDevices returns a list of audio devices that are available and compatible with the audiostreamer object.

    Tip

    You can use the audiodevreset function to refresh the list of available audio devices.

    example

    devices = as.getAudioDevices returns the list using an existing audiostreamer object.

    Examples

    collapse all

    Obtain a list of audio devices that are available and compatible with audiostreamer.

    deviceList = audiostreamer.getAudioDevices
    deviceList = 
    
      1×6 struct array with fields:
    
        Name
        Driver
        MaxRecorderChannels
        MaxPlayerChannels
        SampleRate

    Convert the structure array to a table for inspection.

    struct2table(deviceList)
    ans =
    
      6×5 table
    
                             Name                             Driver        MaxRecorderChannels    MaxPlayerChannels    SampleRate
        _______________________________________________    _____________    ___________________    _________________    __________
    
        "Primary Sound Capture Driver"                     "DirectSound"             2                     0              44100   
        "Microphone Array (Omnissa Virtual Microphone)"    "DirectSound"             1                     0              44100   
        "Primary Sound Driver"                             "DirectSound"             0                     2              44100   
        "Speakers (Horizon Virtual Audio (DevTap))"        "DirectSound"             0                     2              44100   
        "Speakers (Horizon Virtual Audio (DevTap))"        "WASAPI"                  0                     2              48000   
        "Microphone Array (Omnissa Virtual Microphone)"    "WASAPI"                  1                     0              48000 

    Input Arguments

    collapse all

    The audiostreamer object to query.

    Output Arguments

    collapse all

    Available and compatible audio devices, returned as a struct array with information about the device name, driver, sample rate, and recorder and player channels.

    Version History

    Introduced in R2025a