Ejemplo n.º 1
0
 def rounding_duration_test(self):
     """
     Because the durations for each ramp are rounded, we might need to adjust the number
     of samples to make it right.
     """
     ramp_samples = block_functions.ramp(1, (1, 0.004), (1, 0.012), (0, 0.004))
     self.assertEqual(ramp_samples.shape, (int(0.02 * 44100), 1))
Ejemplo n.º 2
0
 def rounding_duration_test(self):
     """
     Because the durations for each ramp are rounded, we might need to adjust the number
     of samples to make it right.
     """
     ramp_samples = block_functions.ramp(1, (1, 0.004), (1, 0.012),
                                         (0, 0.004))
     self.assertEqual(ramp_samples.shape, (int(0.02 * 44100), 1))
Ejemplo n.º 3
0
 def simple_ramp_test(self):
     config.frame_rate = 4
     config.block_size = 2
     ramp_samples = block_functions.ramp(1, (2, 1), (0, 1))
     numpy.testing.assert_array_equal(numpy.round(ramp_samples, 4), numpy.round([
         [1], [1.33333], [1.66666], [2],
         [2], [1.33333], [0.66666], [0]
     ], 4))
Ejemplo n.º 4
0
 def simple_ramp_test(self):
     config.frame_rate = 4
     config.block_size = 2
     ramp_samples = block_functions.ramp(1, (2, 1), (0, 1))
     numpy.testing.assert_array_equal(
         numpy.round(ramp_samples, 4),
         numpy.round([[1], [1.33333], [1.66666], [2], [2], [1.33333],
                      [0.66666], [0]], 4))