#!/usr/bin/env python #Check to see if the script is executing as main. if __name__ == "__main__": import os, commands, glob, time files = glob.glob('*.r*m') + glob.glob('*.smil') os.system('killall -9 artsd') time.sleep(3) # wait a sec for file in files: short_name = os.path.splitext(file)[0] file = os.path.abspath(file) print "file is ", file print "starting vsound" os.system('vsound -d -f %s.wav realplay %s &' % (file,file) ) time.sleep(3600) # wait an hour to kill realplayer os.system('killall -9 realplay') time.sleep(10) # wait for file to be renamed to a .wav print "*** Normalizing" print " normalize-audio %s.wav" % file os.system('normalize-audio %s.wav' % file ) print "*** Encoding" print " lame --preset mw-us %s.wav %s.mp3" % (file,short_name) os.system('lame --preset mw-us %s.wav %s.mp3' % (file,short_name) ) print "*** Moving" print " rm %s.{wav,smil,ram}" % file os.system('rm %s.{wav,smil,ram}' % file ) os.system('/usr/bin/artsd -F 10 -S 4096 -s 30 -m artsmessage -c drkonqi -l 3 -f &') # os.system('notlame --voice -p --abr 36 --resample 32 %s.wav %s.mp3' % (file,file[:-4]) ) # os.system('gogo -b 32 -d 32 -v 8 %s.wav %s.mp3' % (file,file) )