Closed vmorenomarin closed 8 years ago
So, KDE doesn't completely follow the notification spec (yet?) which does specify sounds (which is what I experimented the first time I went looking).
I could however probably play a SoundEffect with QML with a filename entered in the config.
Having the sound file managed in the SystemSettings > Notifications would be nice, but seems ridiculously complicated for a pure QML appplet.
import QtMultimedia 5.6
function createNotification() {
//...
playSound.play()
}
SoundEffect {
id: playSound
source: "file:///usr/share/sounds/Oxygen-Sys-Warning.ogg"
// source: "Oxygen-Sys-Warning.ogg"
}
Doesn't seem to work QSoundEffect(pulseaudio): Error decoding source
. Permission error mayhaps? Nyways, I'll look into it eventually.
Uhg, looks like I was using the wrong class. SoundEffect is used for playing uncompressed file types like wav. I need to use Audio class. Now to pick a good default sound (I'll probably need a file chooser in the settings).
import QtQuick 2.0
import QtMultimedia 5.6
Item {
Audio {
id: playSound
source: "/usr/share/sounds/freedesktop/stereo/complete.oga"
source: "complete"
}
Component.onCompleted: {
playSound.play()
}
}
Added in v30.
Thansk a lot!!!
Hi.
Is there a way to add a sound to the notification when timer has ended?
Thanks.