So you will need to add a custom AngularJS module as per this link - https://help.infiniteautomation.com/getting-started-with-a-user-module/
This component will just watch for new events of a certain level and play the sound, you can customize it to your needs.
define(['angular', 'require'], function(angular, require) {
'use strict';
var userModule = angular.module('userModule', ['maUiApp']);
userModule.component('eventAudio', {
bindings: {
audioFile: '@',
eventLevel: '@'
},
controller: ['maEvents', '$scope', function(maEvents, $scope) {
this.$onInit = () => {
maEvents.notificationManager.subscribe((event, mangoEvent) => {
if (mangoEvent.alarmLevel === this.eventLevel) {
new Audio(this.audioFile).play();
}
}, $scope, ['RAISED']);
};
}]
});
return userModule;
}); // define
Use it like this
<event-audio audio-file="/audio/critical.mp3" event-level="CRITICAL"></event-audio>
If this is all too complicated, I might add something similar to this into the UI module for the next release so sit tight.