PriorityCancellation
Indicates that conflicting announcements are resolved based on their priority. Only the highest priority announcement will be returned by the AnnouncementListener, while others are ignored, effectively being cancelled.
For example, with this strategy, the AnnouncementListener can be implemented as follows:
val announcementListener = AnnouncementListener { announcements ->
with(announcements.first()) {
when (val message = this.message) {
is VerbalMessage -> playAudioMessage(message.ssmlMessage)
is Alert -> playSound(genericNotificationSound)
}
}
}Content copied to clipboard