import os, glob, subprocess, sys

lame = '\"C:\\Program Files\\Lame\\lame.exe\"'

def run(cmd):
    subprocess.Popen(cmd, shell=True).wait()
    
file = sys.argv[1]
targetfilename = file.replace('.wav', '.mp3')
run('p4 open %s' % targetfilename)
run('%s %s %s' % (lame, file, targetfilename) )
run('p4 add %s' % targetfilename)
