def initialize_analysis_interface(self, printversion=True): if 'concateMethod' in self.ops.EXPERIMENTAL and self.ops.EXPERIMENTAL[ 'concateMethod'] == 'framebyframe': util.error( "CONFIG", "Frame by frame concatenation is only possible with the agConcatenateFrames.py script." ) self.p = userinterface.printer( self.ops.VERBOSITY, os.path.dirname(__file__), self.ops.get_outputfile('HTML_LOG_FILEPATH')) if printversion: self.p.printProgramInfo(__version__) self.AnalInterface = self.ops.createAnalInterface(self.p)
None, 'OUTPUT_LABEL_FILEPATH': None, 'TARGET_DESCRIPTORS_FILEPATH': None, 'TARGET_PLOT_DESCRIPTORS_FILEPATH': None, 'SEGMENTATION_FILE_INFO': options.SEGMENTATION_INFO } ops = concatenativeclasses.parseOptions( optsDict=agopts, defaults=defaultpath, scriptpath=os.path.dirname(__file__)) p = userinterface.printer(ops.VERBOSITY, os.path.dirname(__file__), "/tmp/agsegmentationlog.txt") p.printProgramInfo(audioguide.__version__, force=True) AnalInterface = ops.createAnalInterface(p) ############ ## TARGET ## ############ p.middleprint('AUDIOGUIDE SEGMENT SOUNDFILE', force=True) filetosegment = sfsegment.target(ops.TARGET, AnalInterface) filetosegment.initAnal(AnalInterface, ops, p) minamp = util.ampToDb(min(filetosegment.whole.desc['power'])) p.pprint("Evaluating %s from %.2f-%.2f" % (filetosegment.filename, filetosegment.whole.segmentStartSec, filetosegment.whole.segmentEndSec), colour="BOLD") if options.OUTPUT_FILE == '': segFile = file + '.txt'
import numpy as np import json ########################################### ## LOAD OPTIONS AND SETUP SDIF-INTERFACE ## ########################################### ops = concatenativeclasses.parseOptions(opsfile=opspath, defaults=defaultpath, scriptpath=os.path.dirname(__file__)) if 'concateMethod' not in ops.EXPERIMENTAL or ops.EXPERIMENTAL[ 'concateMethod'] != 'framebyframe': util.error( "CONFIG", "agConcatenateFrames.py only supports frame by frame concatenation, e.g. examples/07-concatenateframes.py." ) p = userinterface.printer(ops.VERBOSITY, os.path.dirname(__file__), ops.HTML_LOG_FILEPATH) p.printProgramInfo(audioguide.__version__) AnalInterface = ops.createAnalInterface(p) p.middleprint('EXPERIMENTAL FRAME-BASED CONCATENATION') ############ ## TARGET ## ############ p.logsection("TARGET") tgt = sfsegment.target(ops.TARGET, AnalInterface) tgt.initAnal(AnalInterface, ops, p) tgt.stageSegments(AnalInterface, ops, p) if len(tgt.segs) == 0: util.error( "TARGET FILE",