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

Sound Events Basics

  • Dark
    Light

Article summary

Sound events added to Comflow. They are available to enrich errors or to add sounds in Java rules.

New Class SoundEvent

net.comactivity.core.renderer.sound.SoundEvent

SoundEvent has two fields, severity and soundName. Severity values are modeled after severities in net.comactivity.base.error.CAError. In a similar fashion, default sound names are named to mirror constants in CAError. Default severity is Undefined. soundName will by default be resolved according to severity.

SeveritySeverity valueSound name
Undefined-1empty string
Info0info
Warning10warning
Confirmation20confirmation
Error30error
Fatal99fatal

Sounds in Portal

Both DialogWorkspace and ErrorService has sound events. The sound with highest severity will be added to RendererModel at dialog out. At dynamic requests, the sound with the highest severity be sent as a script reply. One sound will be played at a time in the client.

Add Sounds

Sound files resides in PublicRoot/sounds and are identified by their name, without consideration to their extension.

Comflow ships with placeholder sound files that aren't meant for production use. To properly use sounds, files will have to be added with names that correspond to the default names: info, warning, confirmation, error, and fatal. Custom sounds are added the same way, with a name that corresponds to the sound name used in rules.

Example

A developer decides to use sounds to enrich a customer project's CAError messages. They use SoundKit, and appropriate sound files are added in PublicRoot/sounds with new names.

File Name in SoundKitFile Name in Comflow
Train Station.wavinfo.wav
Confused.wavwarning.wav
Chimey.wavconfirmation.wav
Tongue Out.waverror.wav
Synth Cord.wavfatal.wav

Technical Details

  • Sounds are played in client with Javascript library Buzz.
  • Sound files can be in formats mp3, wav, aac, and ogg.
  • Client needs to have support for HTML5 audio tag to support all formats listed above. There's a fallback for older clients in Comflow's PDA rendering. It uses the tag bgsound and supports wav files.

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.