OSDN Git Service

fix many bugs.
[rec10/rec10-git.git] / rec10 / trunk / src / tv2audio.py
1 import commands
2 import os.path
3 #!/usr/bin/python
4 # coding: UTF-8
5 # Rec10 TS Recording Tools
6 # Copyright (C) 2009-2010 Yukikaze
7 import os
8 import configreader
9 import recdblist
10 def wav2aac_nero(pin,pout):
11     os.environ['LANG']="ja_JP.UTF-8"
12     neroaac=configreader.getpath('NeroAAC')
13     exe=neroaac+" -br 128000 -2pass -if \""+pin+"\" -of \""+pout+"\""
14     txt=u"Cmd : "+exe+"\n"
15     try:
16         txt=txt+commands.getoutput(exe.encode('utf-8'))
17         recdblist.addlog(pin, txt, "Wav2aac_Nero log")
18     except:
19         if not os.path.exists(pout):
20             lame="lame"
21             exe=lame+" -b 128 \""+pin+"\" \""+pout+"\""
22             txt=u"Cmd : "+exe+"\n"
23             txt=txt+commands.getoutput(exe.encode('utf-8'))
24             recdblist.addlog(pin, txt, "Wav2aac_Lame log")
25 def wav2mp3_lame(pin,pout):
26     os.environ['LANG']="ja_JP.UTF-8"
27     lame="lame"
28     exe=lame+" -b 128 \""+pin+"\" \""+pout+"\""
29     txt=u"Cmd : "+exe+"\n"
30     txt=txt+commands.getoutput(exe.encode('utf-8'))
31     recdblist.addlog(pin, txt, "Wav2aac_Lame log")