Overview
The SoundManager is a helper class responsible for managing and playing various types of audio in the CometChat UI Kit. This includes sound events for incoming and outgoing messages and calls.Methods
Play Sound
The SoundManager plays pre-defined or custom sounds based on user interactions with the chat interface. If no custom sound file is provided, the default sound is played.play()
: This method plays different types of sounds for incoming and outgoing calls and messages.
Stop Sound
The SoundManager can Stop different types of sounds for incoming and outgoing calls and messages using the following method:stop()
: This method Stops any sound currently being played.
Usage
Here is how to use SoundManager:Sound | Asset |
---|---|
incomingMessage | assets/sound/incoming_message.wav |
outgoingMessage | assets/sound/outgoing_message.wav |
incomingMessageFromOther | assets/sound/incoming_message.wav |
outgoingCall | assets/sound/outgoing_call.wav |
incomingCall | assets/sound/incoming_call.wav |