Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_ndarray_dbl(self):
layouts = [
('dbl', 'mono', '
def test_ndarray_s16(self):
layouts = [
('s16', 'mono', '
def test_ndarray_u8(self):
layouts = [
('u8', 'mono', 'u1', (1, 160)),
('u8', 'stereo', 'u1', (1, 320)),
('u8p', 'mono', 'u1', (1, 160)),
('u8p', 'stereo', 'u1', (2, 160)),
]
for format, layout, dtype, size in layouts:
array = numpy.random.randint(0, 256, size=size, dtype=dtype)
frame = AudioFrame.from_ndarray(array, format=format, layout=layout)
self.assertEqual(frame.format.name, format)
self.assertEqual(frame.layout.name, layout)
self.assertEqual(frame.samples, 160)
self.assertTrue((frame.to_ndarray() == array).all())
def test_ndarray_flt(self):
layouts = [
('flt', 'mono', '
def test_ndarray_s32(self):
layouts = [
('s32', 'mono', '