Tuesday, December 22, 2009

Python script for lame mp3 encoding

For some reason EAC refused to encode a CD to mp3. Therefore I copied the .wav files and downloaded the lame package from sourceforge. Lame was then compiled and installed under cygwin (1. ./configure 2. make 3. make install). Then with this small python script all tracks could be compressed to mp3:

import os

for i in range(1,28):
call_text="lame -V2 Track%02d.wav Track%02d.mp3"%(i,i)
print call_text
os.system(call_text)


(on the web I had to look up how to do the os.system call and how to pad with zeros to the numbering of the tracks right 01, 02 ,03

No comments:

Post a Comment