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. Before you can use the SoundManager, it must be initialized: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. Here are the available methods for triggering sound playback:-
play(Sound sound)
: This method plays different types of sounds for incoming and outgoing calls and messages. -
play(Sound sound, int res)
: This method is capable of playing a custom sound for a particular raw file passed in this method.
Pause Sound
The SoundManager can pause different types of sounds for incoming and outgoing calls and messages using the following method:pause()
: This method pauses any sound currently being played.