refactor: remove legacy volume_boost references in favor of generalized player effects API
This commit is contained in:
12 files changed
+27
-112
No files matched your search
@@ -40,11 +40,7 @@ class TestYTDLSource(unittest.TestCase):
|
||||
self.assertEqual(empty, b"")
|
||||
self.assertAlmostEqual(ytdl.elapsed, FRAME_LENGTH_SECONDS)
|
||||
|
||||
def test_read_with_volume_boost_over_2_does_not_clamp_to_2(self):
|
||||
# Sample value 5000:
|
||||
# At volume 2.0 (discord limit): 5000 * 2 = 10000
|
||||
# At volume 5.0: 5000 * 5 = 25000
|
||||
# At volume 10.0: 5000 * 10 = 50000 -> clipped to 32767
|
||||
def test_read_with_high_volume_does_not_clamp_to_2(self):
|
||||
pcm = struct.pack("<hh", 5000, -5000)
|
||||
source = DummyPCM(pcm)
|
||||
ytdl = YTDLSource(source, data={"title": "distortion test"}, volume=5.0)
|
||||
@@ -54,11 +50,11 @@ class TestYTDLSource(unittest.TestCase):
|
||||
self.assertEqual(left, 25000)
|
||||
self.assertEqual(right, -25000)
|
||||
|
||||
def test_read_distortion_clips_at_pcm_limits(self):
|
||||
# Overdriving large amplitude samples causes clipping / przester at [-32768, 32767]
|
||||
def test_read_distortion_effect_clips_at_pcm_limits(self):
|
||||
pcm = struct.pack("<hh", 10000, -10000)
|
||||
source = DummyPCM(pcm)
|
||||
ytdl = YTDLSource(source, data={"title": "przester"}, volume=10.0)
|
||||
ytdl = YTDLSource(source, data={"title": "przester"}, volume=1.0)
|
||||
ytdl.set_active_effects({"distortion"})
|
||||
|
||||
data = ytdl.read()
|
||||
left, right = struct.unpack("<hh", data)
|
||||
@@ -66,5 +62,6 @@ class TestYTDLSource(unittest.TestCase):
|
||||
self.assertEqual(right, -32768)
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user