3 from subprocess import Popen, PIPE
8 def gen_raw(description):
9 for chunk in description:
10 for blob in chunk.raw():
14 def encode(filename, data):
15 print "Writing %s" % filename
16 p = Popen(('oggenc', '-o', filename, '--raw', '--quiet', '-'),
17 stdin=PIPE, cwd='data/sounds')
24 def write(basename, description):
25 return encode('%s.ogg' % basename, gen_raw(description))
29 sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
30 from data.sounds import SOUNDS
31 from naja.gen_sound import Chunk
33 sounds = SOUNDS.keys()
37 description = SOUNDS[sound]
38 if isinstance(description, Chunk):
39 description = (description,)
40 write(sound, description)
43 if __name__ == '__main__':