Main Content

audiodevreset

Refresh list of available audio devices

    Description

    example

    audiodevreset refreshes the list of available audio devices. Use this function after adding or removing an audio device on your machine.

    Examples

    collapse all

    Show the available audio devices. Then, connect a device, refresh the list, and show the updated list.

    Call audiodevinfo with no inputs to view information about the input and output audio devices on a system. audiodevinfo returns a structure containing two fields, input and output.

    >> info = audiodevinfo
    
    info = 
    
      struct with fields:
    
         input: [1×1 struct]
        output: [1×1 struct]
    

    Show the names of the available output audio devices.

    >> info.output.Name
    ans =
    
        'Built-in Output (Core Audio)'
    

    After plugging in an audio device, refresh the list of available devices and get information about all devices.

    >> audiodevreset
    >> info = audiodevinfo
    info = 
    
      struct with fields:
    
         input: [1×1 struct]
        output: [1×2 struct]

    Show the names of the available output audio devices again, including the new device.

    >> info.output.Name
    
    ans =
    
        'Built-in Output (Core Audio)'
    
    
    ans =
    
        'HDMI (Core Audio)'
    

    Limitations

    • If you rename an audio device before refreshing the list of devices, the new name of the device will not appear in the list. Instead, its previous name will be displayed. To update the name of the device in the list, you must start a new MATLAB® session.

    More About

    collapse all

    Security Considerations When Using MATLAB Online

    When using audiodevreset in MATLAB Online™, certain features and settings help you keep control of your privacy.

    To reduce the likelihood of unwanted applications using your microphone, turn off automatic access to your audio device. You can change these settings at any time. After granting permission to a website once, your browser may be able to access your microphone automatically for that site on future visits. Use the browser settings for Google Chrome to revoke access for specific sites after you have initially allowed access.

    You can also access the MATLAB Online website using the private browsing mode in Google Chrome. When you do this, Chrome™ automatically asks you for permission to access your microphone every time you open the MATLAB Online site and run audiodevreset, regardless of your browser settings.

    Tips

    • Audio playback in MATLAB Online is supported in Google Chrome™.

    Introduced in R2020b