Skip to main content
CometChatSoundManager is a helper class for managing and playing audio cues in the UI Kit — incoming/outgoing calls and messages. Sound is a frozen object on CometChatSoundManager, not a separate export. Access sound event keys via CometChatSoundManager.Sound.

Methods

play

Plays the default or custom audio resource for a given sound event.

pause

Pauses the currently playing sound and resets playback position.

onIncomingMessage

Plays the incoming message sound directly. Accepts an optional customSound URL.

onIncomingOtherMessage

Plays the incoming message from another user sound directly. Accepts an optional customSound URL.

onOutgoingMessage

Plays the outgoing message sound directly. Accepts an optional customSound URL.

onIncomingCall

Plays the incoming call sound (loops). Accepts an optional customSound URL.

onOutgoingCall

Plays the outgoing call sound (loops). Accepts an optional customSound URL.

hasInteracted

Returns boolean — checks whether the user has interacted with the page (required by browser autoplay policies).

Sound Events

Access via CometChatSoundManager.Sound.incomingCall, etc.

Usage