How to use the munch.IT214Decompressor function in munch

To help you get started, we’ve selected a few munch examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github iamgreaser / it2everything / munch.py View on Github external
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