We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d2c617b commit 16e957dCopy full SHA for 16e957d
tests/pydub_audio_segment_test.py
@@ -29,3 +29,20 @@ def test_from_silent(self):
29
DURATION = 2 * 1000
30
audio_segment = AudioSegment.silent(duration=DURATION)
31
assert 2 == audio_segment.duration_seconds
32
+
33
+ def test_normalize_silence_no_change(self):
34
+ silent_seg = AudioSegment.silent(
35
+ duration=1000
36
+ ) # Create a 1-second silent AudioSegment
37
38
+ normalized_silent = silent_seg.normalize()
39
+ assert normalized_silent == silent_seg
40
41
+ def test_normalize_silence_changed(self):
42
+ data_dir = os.path.dirname(os.path.realpath(__file__))
43
+ filename = os.path.join(data_dir, "data/this_is_a_test.mp3")
44
+ audio_segment = AudioSegment.from_file(filename)
45
46
+ normalized = audio_segment.normalize()
47
+ assert normalized != audio_segment
48
+ # TODO check normalization
0 commit comments