Skip to content

Conversation

Dwscdv3
Copy link

@Dwscdv3 Dwscdv3 commented Aug 12, 2025

Related issue #1703

All features mentioned in that issue are implemented.

Added

  • Logarithmic peak meter
  • dB value on label instead of percent
  • Adjustable logarithmic slider range (current default: 40 dB, range 12 to 96 dB)
    • This is meant to be calibrated by the user to their barely audible level
  • Hot reload internal and UI state when certain settings are changed

Changed

  • Now uses logarithmic API for device volume, because SetMasterVolumeScalar is non-linear and we will get wrong result if we treat it as linear then compute log value based on it. Sessions are still work with linear API since they only have a linear API.
  • Changed some view models' Volume field from int to float.

Notes

  • Channels don't automatically get muted when slider is at the minimum, this is by design, not a bug, since it's still a non-zero value.

Known Problems

  • Added UseLogarithmicVolumeChanged event handlers to various classes, but this may cause memory leak in AudioDeviceSession because that class don't have any clean up mechanism. (Finalizers won't work)
  • Slider value may occasionally flash to 0 (max) when dragging in logarithmic mode, actual volume is unaffected by this.
  • A TextBlock is yet to be localized.

@CLAassistant
Copy link

CLAassistant commented Aug 12, 2025

CLA assistant check
All committers have signed the CLA.

@Dwscdv3 Dwscdv3 changed the title Reimplantation of logarithmic volume Reimplementation of logarithmic volume Aug 12, 2025
@Dwscdv3
Copy link
Author

Dwscdv3 commented Aug 12, 2025

Oops, I accidentally messed up App.xaml.cs, gonna revert it

@Dwscdv3
Copy link
Author

Dwscdv3 commented Aug 12, 2025

By the way, I think the Chinese translation of the switch should be “使用对数比例音量条” or “用对数比例表示音量” rather than “使用对数音量缩放”

The min dB setting may be called “对数比例音量条的最低分贝”

Copy link
Contributor

@riverar riverar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty great(!), just some minor things. I'll test it out and have some feedback on text for loc.

@Dwscdv3
Copy link
Author

Dwscdv3 commented Aug 16, 2025

Thanks for your appreciation! I didn't test it out thoroughly though and there might still be some intermittent bugs.

Width="200"
IsSnapToTickEnabled="True"
TickFrequency="1"
IsDirectionReversed="True"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

This doesn't feel natural at all; perhaps change IsDirectionReversed to False?

Also, it should remain disabled if the option is not enabled to reinforce they are linked together.

Copy link
Author

@Dwscdv3 Dwscdv3 Aug 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking of this slider as the volume range so I made it reversed but… the color is also reversed. I'm considering whether to un-reverse it or just change the label to range instead of min dB. How do you think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your choice, but the color needs to be flipped so it matches everyone's expectations of that slider control.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants