Sound Events in Rules
  • 03 Nov 2020
  • 1 Minute to read
  • Contributors
  • Dark
    Light

Sound Events in Rules

  • Dark
    Light

Article summary

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.


Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.