Miscellany
public text v1 · immutable#!/usr/bin/python
#
# Copyright (c) 2007 Elliot Peele <elliot@bentlogic.net>
#
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)