From 668ea868c411237e01ee9e4e61281fa1cc023490 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Tinkl?= Date: Fri, 9 Dec 2022 16:17:56 +0100 Subject: [PATCH] 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 --- ui/app/AppLayouts/Profile/views/NotificationsView.qml | 5 +++++ ui/imports/utils/Audio.qml | 4 +++- vendor/DOtherSide | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ui/app/AppLayouts/Profile/views/NotificationsView.qml b/ui/app/AppLayouts/Profile/views/NotificationsView.qml index 536acbeb41..30b2560c63 100644 --- a/ui/app/AppLayouts/Profile/views/NotificationsView.qml +++ b/ui/app/AppLayouts/Profile/views/NotificationsView.qml @@ -468,6 +468,11 @@ SettingsContentBase { Component.onCompleted: { value = appSettings.volume + volumeSlider.valueChanged.connect(() => { + // play a sound preview, but not on startup + Global.notificationSound.stop() + Global.notificationSound.play() + }); } } diff --git a/ui/imports/utils/Audio.qml b/ui/imports/utils/Audio.qml index d56b7fcbcf..2f0000cdb1 100644 --- a/ui/imports/utils/Audio.qml +++ b/ui/imports/utils/Audio.qml @@ -7,7 +7,9 @@ T.Audio { property var store audioRole: Audio.NotificationRole - volume: store.volume + volume: T.QtMultimedia.convertVolume(store.volume, + T.QtMultimedia.LogarithmicVolumeScale, + T.QtMultimedia.LinearVolumeScale) muted: !store.notificationSoundsEnabled onError: console.warn("Audio error:", errorString, "; code:", error) } diff --git a/vendor/DOtherSide b/vendor/DOtherSide index 5fecb811aa..75b70971ca 160000 --- a/vendor/DOtherSide +++ b/vendor/DOtherSide @@ -1 +1 @@ -Subproject commit 5fecb811aa471c609f06534775599ff245f12c83 +Subproject commit 75b70971caf863629b4af83be254c04a84ef8c1e