Esempio n. 1
0
def encodeFile(job):

    # create output directory if necessary
    (outdir, outfile) = os.path.split(job.outfile)
    if not os.path.isdir(outdir):
        try:
            os.makedirs(outdir)
        except:
            notify("Can't create path %s" % outdir)
            os._exit(1)

    cmd = [
        'opusenc',  # accept default bitrate of 96kbps per stereo pair
        '--quiet',
        '--artist',
        job.artist,
        '--album',
        job.album,
        '--title',
        job.title,
        '--comment',
        'TRACKNUMBER=%s' % str(job.tracknum)
    ]
    if job.coverart: cmd.extend(['--picture', job.coverart])
    cmd.extend(['-', job.outfile])
    flac_stdout = flaclib.flacpipe(job.flacfile, job.tracknum)
    opus_child = subprocess.Popen(cmd, stdin=flac_stdout)
    flac_stdout.close()  # recall it's been duplicated into the lame process
    opus_child.wait()
    os._exit(opus_child.returncode)
Esempio n. 2
0
def encodeFile(job):

    # create output directory if necessary
    (outdir, outfile) = os.path.split(job.outfile)
    if not os.path.isdir(outdir):
        try:
            os.makedirs(outdir)
        except:
            print "Can't create path", outdir
            os._exit(1)
        
    # Beware, untested!
    cmd = ['faac', '-o', job.outfile,
           '--artist', job.artist,
           '--album', job.album,
           '--title', job.title,
           '--track', str(job.tracknum)]
    if job.coverart:
        cmd.extend(['--cover-art', job.coverart])
    cmd.append('-')
    flac_stdout = flaclib.flacpipe(job.flacfile, job.tracknum)
    faac_child = subprocess.Popen(cmd, stdin=flac_stdout)
    flac_stdout.close()
    faac_child.wait()
    os._exit(faac_child.returncode)
Esempio n. 3
0
def encodeFile(job):

    # create output directory if necessary
    (outdir, outfile) = os.path.split(job.outfile)
    if not os.path.isdir(outdir):
        try:
            os.makedirs(outdir)
        except:
            notify("Can't create path %s" % outdir)
            os._exit(1)

    cmd = [
        flaccfg.BIN_OGG, '-o', job.outfile, '-a', job.artist, '-l', job.album,
        '-t', job.title, '-N',
        str(job.tracknum), '-'
    ]
    flac_stdout = flaclib.flacpipe(job.flacfile, job.tracknum)
    ogg_child = subprocess.Popen(cmd, stdin=flac_stdout)
    flac_stdout.close()
    ogg_child.wait()
    os._exit(ogg_child.returncode)
Esempio n. 4
0
def encodeFile(job):
    
    # create output directory if necessary
    (outdir, outfile) = os.path.split(job.outfile)
    if not os.path.isdir(outdir):
        try:
            os.makedirs(outdir)
        except:
            notify("Can't create path %s" % outdir)
            os._exit(1)

    cmd = [flaccfg.BIN_OGG, '-o', job.outfile,
           '-a', job.artist,
           '-l', job.album,
           '-t', job.title,
           '-N', str(job.tracknum),
           '-']
    flac_stdout = flaclib.flacpipe(job.flacfile, job.tracknum)
    ogg_child = subprocess.Popen(cmd, stdin=flac_stdout)
    flac_stdout.close()
    ogg_child.wait()
    os._exit(ogg_child.returncode)
Esempio n. 5
0
def encodeFile(job):
    
    # create output directory if necessary
    (outdir, outfile) = os.path.split(job.outfile)
    if not os.path.isdir(outdir):
        try:
            os.makedirs(outdir)
        except:
            notify("Can't create path %s" % outdir)
            os._exit(1)

    cmd = [flaccfg.BIN_LAME, '--preset', 'standard',
           '--ta', job.artist,
           '--tl', job.album,
           '--tt', job.title,
           '--tn', str(job.tracknum)]
    if job.coverart:
        cmd.extend(['--ti', job.coverart])
    cmd.extend(['-', job.outfile])
    flac_stdout = flaclib.flacpipe(job.flacfile, job.tracknum)
    lame_child = subprocess.Popen(cmd, stdin=flac_stdout)
    flac_stdout.close() # recall it's been duplicated into the lame process
    lame_child.wait()
    os._exit(lame_child.returncode)
Esempio n. 6
0
def encodeFile(job):
    
    # create output directory if necessary
    (outdir, outfile) = os.path.split(job.outfile)
    if not os.path.isdir(outdir):
        try:
            os.makedirs(outdir)
        except:
            notify("Can't create path %s" % outdir)
            os._exit(1)

    cmd = ['opusenc', # accept default bitrate of 96kbps per stereo pair
           '--quiet',
           '--artist', job.artist,
           '--album', job.album,
           '--title', job.title,
           '--comment', 'TRACKNUMBER=%s' % str(job.tracknum)]
    if job.coverart: cmd.extend(['--picture', job.coverart])
    cmd.extend(['-', job.outfile])
    flac_stdout = flaclib.flacpipe(job.flacfile, job.tracknum)
    opus_child = subprocess.Popen(cmd, stdin=flac_stdout)
    flac_stdout.close() # recall it's been duplicated into the lame process
    opus_child.wait()
    os._exit(opus_child.returncode)
Esempio n. 7
0
def encodeFile(job):

    # create output directory if necessary
    (outdir, outfile) = os.path.split(job.outfile)
    if not os.path.isdir(outdir):
        try:
            os.makedirs(outdir)
        except:
            notify("Can't create path %s" % outdir)
            os._exit(1)

    cmd = [
        flaccfg.BIN_LAME, '--preset', 'medium', '--ta', job.artist, '--tl',
        job.album, '--tt', job.title, '--tn',
        str(job.tracknum)
    ]
    if job.coverart:
        cmd.extend(['--ti', job.coverart])
    cmd.extend(['-', job.outfile])
    flac_stdout = flaclib.flacpipe(job.flacfile, job.tracknum)
    lame_child = subprocess.Popen(cmd, stdin=flac_stdout)
    flac_stdout.close()  # recall it's been duplicated into the lame process
    lame_child.wait()
    os._exit(lame_child.returncode)