Skip to content

Commit

Permalink
audio now ripped with dBpoweramp console ripper
Browse files Browse the repository at this point in the history
  • Loading branch information
bitsgalore committed Feb 24, 2017
1 parent 90f0adb commit 3865a16
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 12 deletions.
21 changes: 9 additions & 12 deletions iromlab/cdworker.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,24 +164,21 @@ def processDisc(carrierData):
# 2. If disc is of CD-Extra type, there's one data track on the 2nd session
if carrierInfo["containsAudio"] == True:
logging.info('*** Ripping audio ***')
# Rip audio to WAV
# TODO: replace by dBpoweramp wrapper in production version
# Also IsoBuster (3.8.0) erroneously extracts data from any data sessions here as well
# (and saves file with .wav file extension!)
# Rip audio using dBpoweramp console ripper
dirOut = dirDisc

resultIsoBuster = isobuster.ripAudio(dirOut, 1)

statusIsoBuster = resultIsoBuster["log"].strip()
resultdBpoweramp = dbpoweramp.consoleRipper(dirOut)
statusdBpoweramp = str(resultdBpoweramp["status"])

if statusIsoBuster != "0":
if statusdBpoweramp != "0":
success = False
reject = True
logging.error("Isobuster exited with error(s)")
logging.error("dBpoweramp exited with error(s)")

logging.info(''.join(['isobuster command: ', resultIsoBuster['cmdStr']]))
logging.info(''.join(['isobuster-status: ', str(resultIsoBuster['status'])]))
logging.info(''.join(['isobuster-log: ', statusIsoBuster]))
logging.info(''.join(['dBpoweramp command: ', resultdBpoweramp['cmdStr']]))
logging.info(''.join(['dBpoweramp-status: ', str(resultdBpoweramp['status'])]))

# TODO: parse dBpoweramp's log file line-by line and then report each line to logging.info

if carrierInfo["cdExtra"] == True and carrierInfo["containsData"] == True:
logging.info('*** Extracting data session of cdExtra to ISO ***')
Expand Down
45 changes: 45 additions & 0 deletions iromlab/dbpoweramp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#! /usr/bin/env python

import os

if __package__ == 'iromlab':
from . import config
from . import shared
else:
import config
import shared

# Wrapper module for dBpoweramp

def consoleRipper(writeDirectory):
# Rip audio to to WAV or FLAC (depending on dBpoweramps settings in default profile)
# Uses the bespoke dBpoweramp console ripper which was developed at request of KB
# dBpoweramp\kb-nl-consolerip.exe" --drive="D" --log=E:\cdBatchesTest\testconsolerip\log.txt --path=E:\cdBatchesTest\testconsolerip\
#
logFile = ''.join([config.tempDir,shared.randomString(12),".log"])

args = [config.dBpowerampConsoleRipExe]
args.append("".join(["--drive=", config.cdDriveLetter]))
args.append("".join(["--log=", logFile]))
args.append("".join(["--path=", writeDirectory]))

# Command line as string (used for logging purposes only)
cmdStr = " ".join(args)

status, out, err = shared.launchSubProcess(args)

fLog = open(logFile, 'r')
log = fLog.read()

fLog.close()
os.remove(logFile)

# All results to dictionary
dictOut = {}
dictOut["cmdStr"] = cmdStr
dictOut["status"] = status
dictOut["stdout"] = out
dictOut["stderr"] = err
dictOut["log"] = log

return(dictOut)

0 comments on commit 3865a16

Please sign in to comment.