Lukáš Tinkl 668ea868c4 fix(notifications): The sound of notifications is harsh and annoying
Use logarithmic sound volume scale instead of linear when interpreting
the sound volume value

TLDR; we were literally overblowing the speakers with absolute sound
volume levels; for the whole story I recommend reading:
https://www.dr-lex.be/info-stuff/volumecontrols.html

Also play a sound preview when changing the volume in Settings

Needs https://github.com/status-im/dotherside/pull/83

Fixes #8426
2022-12-12 11:39:32 +01:00

16 lines
467 B
QML

import QtQuick 2.14
import QtMultimedia 5.14 as T
T.Audio {
id: audio
property var store
audioRole: Audio.NotificationRole
volume: T.QtMultimedia.convertVolume(store.volume,
T.QtMultimedia.LogarithmicVolumeScale,
T.QtMultimedia.LinearVolumeScale)
muted: !store.notificationSoundsEnabled
onError: console.warn("Audio error:", errorString, "; code:", error)
}