Exemple #1
0
 def test_byte_to_int_and_back(self):
     b = b'abcd'
     n = byte_tools.bytes_to_int(b)
     self.assertEqual(b, byte_tools.int_to_bytes(n))
Exemple #2
0
 def __getitem__(self, num):
     sample_size = self.chunks["fmt "].block_align // self.chunks["fmt "].num_channels
     return byte_tools.bytes_to_int(self.chunks["data"].data[num * sample_size: (num + 1)*sample_size])