---
schema_version: "1"
id: 5a454243ae6a6bacad152a12d781276247008bda36e983fdedae224322d92751
title: Audio Messages
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/aura-platform/guides/aura/accessibility/accessibility-messages.md
canonical_url: https://developer.salesforce.com/docs/platform/aura-platform/guide/accessibility-messages.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 49da10b74ebc5dbe7abf8c2c6f29d10887950f28d06ba1a11419f4df2ba31c4e
products:
  - Lightning Aura Components Developer Guide
  - Platform Developer Content
---

# Audio Messages

To convey audio notifications, create a toast using `lightning:notificationsLibrary`. The toast is rendered with `role="alert"`, which enables screen readers to announce the text inside the toast without any additional action by the user.

If you’re creating your own feedback mechanism and work with multiple toasts, consider using `role="status"` to persist the toast in the queue. This role reduces the risk of a user missing a toast message. Contrastingly, `role="alert"` overrides previous toasts in the screen reader’s speech queue. For more information, see the [toast](https://lightningdesignsystem.com/components/toast/) accessibility guideline.

<!-- otherprops: set_clipboard -->
```nolang
<lightning:notificationsLibrary aura:id="notifLib"/>
<lightning:button name="toast" label="Show Toast" onclick="{!c.handleShowToast}"/>
```

```javascript
({
    handleShowToast : function(component, event, helper) {
        component.find('notifLib').showToast({
            "title": "Success!",
            "message": "The record has been updated successfully."
        });
    }
})
```

Alternatively, create a prompt notice to alert a user of system-related issues or updates. The notice is rendered as a modal dialog with `role="dialog"`, and must be dismissed before you can return to the rest of the page.

<!-- otherprops: set_clipboard -->
```nolang
<lightning:notificationsLibrary aura:id="notifLib"/>
<lightning:button name="notice" label="Show Notice" onclick="{!c.handleShowNotice}"/>
```

```javascript
({
    handleShowNotice : function(component, event, helper) {
        component.find('notifLib').showNotice({
            "variant": "error",
            "header": "Something has gone wrong!",
            "message": "Unfortunately, there was a problem updating the record.",
            closeCallback: function() {
                alert('You closed the alert!');
            }
        });
    }
})
```

`lightning:notificationsLibrary` implements the [prompt](https://www.lightningdesignsystem.com/components/prompt) and [toast](https://lightningdesignsystem.com/components/toast/) blueprint in the Salesforce Lightning Design System and follows its accessibility guidelines.

**See Also**  


-   [*Component Library*: lightning:notificationsLibrary documentation](https://developer.salesforce.com/docs/component-library/bundle/lightning:notificationsLibrary)

