#!/usr/bin/python # # Copyright (c) 2007 Elliot Peele # import os import subprocess for file in os.listdir(os.getcwd()): if not file.endswith('.flac'): continue oggName = '.'.join(file.split('.')[:-1]) + '.ogg' if os.path.exists(oggName): continue print "Converting %s to ogg" % file cmd = [ '/usr/bin/oggenc', '-b', '256', '-o%s' % oggName, file ] subprocess.call(cmd)