Hello @LeoWillian,
You ca create a 1 second timer object to get system current time and play a sound when current times equal to your alarm time:
property var hms: {'hours': 0, 'minutes': 0, 'seconds': 0 } // (object containing integer numbers representing hours, minutes, seconds)
Timer {
interval: 1000;
running: true;
repeat: true
onTriggered: {
var dt = new Date()
currentTime = dt.toLocaleTimeString(Qt.locale('EN'), "hh:mm:ss")
hms = {'hours': dt.getHours(), 'minutes': dt.getMinutes(), 'seconds': dt.getSeconds()}
if (hms.hours === alarmTime.hours &&
hms.minutes === alarmTime.minutes &&
hms.seconds === 0) {
console.info("ALARM!!!")
alarmSound.play()
}
}
}
MediaPlayer {
id: alarmSound
source: "./sounds/pager-beeps.wav"
loops: SoundEffect.Infinite
audioOutput: AudioOutput {}
}
To stop alarm sound you can use:
alarmSound.stop()
Best regards