def test_peak_normalize_no_change(self): samples = self.make_test_sine(44100, 100) samplesNorm = AudioBuffer.peak_normalize(samples) np.testing.assert_array_almost_equal(samples, samplesNorm, decimal=5)
def test_peak_normalize(self): samples = self.make_test_sine(44100, 100) samplesHalfAmp = samples * 0.5 samplesNorm = AudioBuffer.peak_normalize(samples) np.testing.assert_array_equal(samples, samplesNorm)