Add R128_{TRACK,ALBUM}_GAIN support to the scanner (#3072)

* Add R128 gain tags support to the scanner

* Add R128 test to metadata_internal_test.go

* Pass explicit tag names to getGainValue function
This commit is contained in:
kartikynwa
2024-06-08 23:15:06 +05:30
committed by GitHub
parent e434ca9372
commit 56303cde23
2 changed files with 45 additions and 13 deletions
@@ -128,5 +128,17 @@ var _ = Describe("Tags", func() {
Entry("Infinity", "Infinity", 1.0),
Entry("Invalid value", "INVALID VALUE", 1.0),
)
DescribeTable("getR128GainValue",
func(tag string, expected float64) {
md := &Tags{}
md.Tags = map[string][]string{"r128_track_gain": {tag}}
Expect(md.RGTrackGain()).To(Equal(expected))
},
Entry("0", "0", 5.0),
Entry("-3776", "-3776", -9.75),
Entry("Infinity", "Infinity", 0.0),
Entry("Invalid value", "INVALID VALUE", 0.0),
)
})
})