Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import struct
from PIL import Image, ImageDraw
data = open("simone.wav.raw", "rb").read()
im = Image.new("RGB", (1000, 1000))
draw = ImageDraw.Draw(im)
prev = None
for i in xrange(0, 0xf00, 4):
L, R = struct.unpack("<hh", data[i:i+4])
print L, R
if prev is not None:
draw.line((prev, (L / 20, 500 + R / 20)), (255,255,255))
prev = L / 20, 500 + R / 20
im.save("test.png")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment