Skip to main content

Overview

CometChatSoundManager is a helper class that manages audio playback in the CometChat UI Kit. It handles sound events for incoming and outgoing messages and calls, supporting both default sounds and custom audio files.

Methods

Play Sound

The play(sound:customSound:) method triggers audio playback based on user interactions with the chat interface. If no custom sound file is provided, the default sound for that event type is played.

Pause Sound

The pause() method stops any sound currently being played by the SoundManager.

Usage

Playing Default Sounds

Play the default sound for an incoming message:

Playing Custom Sounds

Provide a custom audio file URL to override the default sound:

Pausing Sounds

Stop any currently playing sound:

Sound Types

The Sound enum provides the following options:
By using CometChatSoundManager, you can enhance the user experience in your chat application by integrating audible cues for chat interactions.

Next Steps

Theme Introduction

Customize the visual appearance

Localization

Adapt to different languages

Component Styling

Style individual components