soundmail.png
The cover document was a song from the Blues Brothers, "Rawhide". The title suggests that the method used is simple. This was indeed one of the most straightforward challenges: take the lsb from every frame, and you're done. The frames are in 16 bits little endian format, so we need to take one every two bytes. There are two audio channels, but this isn't important. The size of the file is given in the first four bytes, as in the bmp challenge.

#!/usr/bin/python
import wave
 
def debin(s):
    return "".join(chr(int(s[i:i+8],2)) for i in range(0,len(s),8))
 
w = wave.open("sound.wav")
nbframes = w.getnframes()
frames = w.readframes(nbframes)
lsbsize = "".join( str(ord(i)&1) for i in frames[0:64:2] )
size = int(lsbsize,2)*8
lsbfile = "".join( str(ord(i)&1) for i in frames[64:64+size*2:2] )
pdf = debin(lsbfile)
 
outfile = open("ndh2012_sound.pdf","wb")
outfile.write(pdf)
outfile.close()