Main Content

audiodevreset

Refresh list of available audio devices

    Syntax

    Description

    example

    audiodevresetrefreshes 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.

    Callaudiodevinfowith no inputs to view information about the input and output audio devices on a system.audiodevinforeturns a structure containing two fields,inputandoutput.

    > >信息= 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 UsingMATLABOnlineorMATLABWeb App Server

    When usingaudiodevresetinMATLAB Online™orMATLAB Web App Server™, 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 forGoogle Chrometo revoke access for specific sites after you have initially allowed access.

    You can also access theMATLAB Onlinewebsite orMATLAB Web App Serverusing the private browsing mode inGoogle Chrome. When you do this, Chrome™ automatically asks you for permission to access your microphone every time you open theMATLAB Onlinesite or theMATLAB Web App Serverand runaudiodevreset, regardless of your browser settings.

    Tips

    • Audio playback inMATLAB OnlineandMATLAB Web App Serverare supported in Google Chrome™.

    Version History

    ‘茵特罗德女士’uced in R2020b