Skip to content

🎧 Your Personal Streaming Service

Workaround to remember logarithmic volume

Deluan591a5344acd0
diff --git a/ui/src/audioplayer/Player.js b/ui/src/audioplayer/Player.js
index d7d1dfd2a..bf5ab2d94 100644
--- a/ui/src/audioplayer/Player.js
+++ b/ui/src/audioplayer/Player.js
@@ -198,9 +198,8 @@ const Player = () => {
])
const onAudioListsChange = useCallback(
- (currentPlayIndex, audioLists) => {
- dispatch(syncQueue(currentPlayIndex, audioLists))
- },
+ (currentPlayIndex, audioLists) =>
+ dispatch(syncQueue(currentPlayIndex, audioLists)),
[dispatch]
)
@@ -230,7 +229,8 @@ const Player = () => {
)
const onAudioVolumeChange = useCallback(
- (volume) => dispatch(setVolume(volume)),
+ // sqrt to compensate for the logarithmic volume
+ (volume) => dispatch(setVolume(Math.sqrt(volume))),
[dispatch]
)
@@ -260,12 +260,9 @@ const Player = () => {
[dispatch, showNotifications]
)
- const onAudioPause = useCallback(
- (info) => {
- dispatch(currentPlaying(info))
- },
- [dispatch]
- )
+ const onAudioPause = useCallback((info) => dispatch(currentPlaying(info)), [
+ dispatch,
+ ])
const onAudioEnded = useCallback(
(currentPlayId, audioLists, info) => {