Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if DECOMPRESS_IT214:
self.data = []
xlen = length
do_stereo = (flags & 4) != 0
if do_stereo:
xlen >>= 1
while xlen > 0:
blkcomplen, = struct.unpack("= 0x8000:
# print "WARNING: Compressed block length is > 32KB."
# print "You most likely didn't use ImpulseTracker."
print "compressed: %i" % blkcomplen
decomp = IT214Decompressor(fp.read(blkcomplen), xlen, (flags & 2) != 0)
if DECOMPRESS_IT214:
xdata = decomp.get_data()
if cvt & 4:
print "undeltafying IT215 sample"
base = 0
if flags & 2:
for i in xrange(len(xdata)):
base += xdata[i]
base &= 0xFFFF
xdata[i] = base
else:
for i in xrange(len(xdata)):
base += xdata[i]
base &= 0xFF
xdata[i] = base