@quadrel-enterprise-ui/alarm
v20.0.1
Published
Library for playing alarm sounds, for example to draw attention to an application or notification
Readme
qd-alarm
Plays audio alarms (beep, ship-horn) in Angular applications.
Setup
@NgModule({
imports: [QdAlarmModule]
})API
play(type, duration?)
Plays a sound once. With duration (ms) it loops and stops automatically.
alarmService.play('beep'); // plays once
alarmService.play('ship-horn', 5000); // loops, stops after 5 splayUntilPaused(type)
Loops until manually paused.
const audio = alarmService.playUntilPaused('beep');
audio.pause(); // stop