Skip to content

NumberDecimalSeparator at Track/Album Peak/Gain#54

Merged
jherby2k merged 2 commits intojherby2k:devfrom
m-mrks:replaygain
Jan 25, 2026
Merged

NumberDecimalSeparator at Track/Album Peak/Gain#54
jherby2k merged 2 commits intojherby2k:devfrom
m-mrks:replaygain

Conversation

@m-mrks
Copy link
Copy Markdown

@m-mrks m-mrks commented Jan 22, 2026

Hi,

Thanks for this great module!

Found a minor issue regarding the accuracy of AudioWorks.Commands 2.2.0's Measure-AudioFile -Analyzer ReplayGain function related to the number decimal separator.

Tested on Windows 11 with PowerShell 7.4.2; the issue only occurs when the decimal separator is not . but e.g. ,.

PS C:\> (Get-Culture).NumberFormat.NumberDecimalSeparator
,

PS C:\> $audioFile = Get-AudioFile -Path 'D:\path\file.flac'
PS C:\> $audioFile | Clear-AudioMetadata -PassThru
PS C:\> $audioFile | Measure-AudioFile -Analyzer ReplayGain -PassThru | Save-AudioMetadata -PassThru
PS C:\> $audioFile | Get-AudioMetadata
[...]
TrackPeak   : 880828857421874987008.000000
AlbumPeak   : 880828857421874987008.000000
TrackGain   : -305455684738429568.00 dB
AlbumGain   : -305455684738429568.00 dB

Expected:

PS C:\> $audioFile | Get-AudioMetadata
[...]
TrackPeak   : 0.880829
AlbumPeak   : 0.880829
TrackGain   : -3.05 dB
AlbumGain   : -3.05 dB

else
{
if (!double.TryParse(value, out var floatValue) || floatValue < 0)
if (!double.TryParse(value, System.Globalization.NumberStyles.Float, CultureInfo.InvariantCulture, out var floatValue) || floatValue < 0)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Can you move these System.Globalization.NumberStyles to a "using" at the top?

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Can you put this test in AudioMetadataTests rather than a separate file? Appreciated!

Copy link
Copy Markdown
Owner

@jherby2k jherby2k left a comment

Choose a reason for hiding this comment

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

Just a couple of formatting changes but your PR looks good! Thanks a bunch for fixing it.

@jherby2k jherby2k changed the base branch from main to dev January 25, 2026 20:22
@jherby2k jherby2k merged commit f2e6b96 into jherby2k:dev Jan 25, 2026
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.

2 participants