Sound Events in Rules
Sound Events in Java Rules
Sounds can be added in Java rules. Create a SoundEvent
and add it to DialogWorkspace
. A sound will be played according to severity assuming no other sounds with higher severity are added.
Example
private void createSound(String soundName) {
SoundEvent soundEvent = new SoundEvent(SoundEvent.SEV_INFO);
soundEvent.setSoundName(soundName);
dialogWorkspace.setSoundEvent(soundEvent);
}
Sound Events in Java Dynamic Rules
Sounds can also be added in Java dynamic rules. Use the same approach as in regular Java rules; create a SoundEvent
and add it toDialogWorkspace
.