You are not logged in.
Pages: 1
#! /usr/bin/env python
import sys, os
from subprocess import Popen
# Mp3 ==> Wav
file_in = raw_input("Mp3 file:")
cmd1 = "mpg321 -q -w in.wav " + file_in
retcode = Popen(cmd1, shell=True).wait()
if retcode != 0:
print 'Mp3 ==> Wav failed.'
# Wav ==> Ogg
# ==>
opt = raw_input("1)Quality Mode" +
"2)Bitrate mode\n")
if opt == 1:
quality = raw_input("Select quality \n\n 1)Low \n\n 3)Normal " +
"\n\n 5)Higth\n")
cmd2 = "oggenc -q " + quality + " in.wav"
retcode = Popen(cmd2, shell=True).wait()
if retcode != 0:
print 'Wav ==> Ogg failed.'
elif opt == 2:
min_br = raw_input("Select minimum bitrate:")
max_br = raw_input("Select maximum bitrate:")
cmd2 = "oggenc -m " + min_br +" -M " + max_br + " in.wav"
retcode = Popen(cmd2, shell=True).wait()
if retcode != 0:
print 'Wav ==> Ogg failed.'
Arrived to the ==> line, the program exits...why???
Tnks
Last edited by The_ouroboros (2007-08-03 08:40:46)
Gnu/Linux User on Arch(x86_64)
Offline
--- t.py.old 2007-08-03 18:19:30.000000000 -0400
+++ t.py 2007-08-03 18:18:28.000000000 -0400
@@ -4,7 +4,7 @@
# Mp3 ==> Wav
file_in = raw_input("Mp3 file:")
-cmd1 = "mpg321 -q -w in.wav " + file_in
+cmd1 = "mpg321 -q -w in.wav \"" + file_in + "\""
retcode = Popen(cmd1, shell=True).wait()
if retcode != 0:
@@ -15,14 +15,14 @@
opt = raw_input("1)Quality Mode" +
"2)Bitrate mode\n")
-if opt == 1:
+if opt == "1":
quality = raw_input("Select quality \n\n 1)Low \n\n 3)Normal " +
"\n\n 5)Higth\n")
cmd2 = "oggenc -q " + quality + " in.wav"
retcode = Popen(cmd2, shell=True).wait()
if retcode != 0:
print 'Wav ==> Ogg failed.'
-elif opt == 2:
+elif opt == "2":
min_br = raw_input("Select minimum bitrate:")
max_br = raw_input("Select maximum bitrate:")
cmd2 = "oggenc -m " + min_br +" -M " + max_br + " in.wav"
Offline
Pages: 1