AI Agent Component Spec
AI Agent Component Spec
| Field | Value |
|---|---|
| Package | cometchat_uikit_shared |
| Import | import 'package:cometchat_uikit_shared/cometchat_uikit_shared.dart'; |
| Class | SoundManager (singleton) |
| Play sound | SoundManager().play(sound: Sound.incomingMessage) |
| Stop sound | SoundManager().stop() |
| Sound events | incomingMessage, outgoingMessage, incomingMessageFromOther, incomingCall, outgoingCall |
| Source | GitHub |
SoundManager is a singleton helper class for managing and playing audio cues — incoming/outgoing calls and messages.
Methods
play
Plays the default or custom audio for a sound event.| Parameter | Type | Description |
|---|---|---|
sound | Sound | Required. The sound event type to play |
customSound | String? | Optional. Asset path for custom sound file |
packageName | String? | Optional. Package name when using sounds from another plugin |
isLooping | bool? | Optional. Whether to loop the sound (default: false) |
stop
Stops any currently playing sound.Sound Enum
| Value | Default Asset | When it plays |
|---|---|---|
incomingMessage | assets/sound/incoming_message.wav | New message received |
outgoingMessage | assets/sound/outgoing_message.wav | Message sent |
incomingMessageFromOther | assets/sound/incoming_message.wav | Message from another conversation |
incomingCall | assets/sound/incoming_call.wav | Incoming call detected |
outgoingCall | assets/sound/outgoing_call.wav | Outgoing call initiated |
Usage
Sound behavior varies by OS when the app is in the background.