def getInputs(self): """ Get input metadata. Result format is the same as for :py:meth:`getOutputs` method, but the general case is that there is only one input named 'audio' and the sole relevant metadata are: :sampleRate: expected audio sampleRate :parameters: attached parameters Others fields should be set to 1. """ res = {} iList = yc.engine_getInputList(self.ptr) for inputname in iterPtrList(iList): ptr = yc.engine_getInputInfos(self.ptr, inputname) infos = {} if ptr: infos['sampleRate'] = ptr.contents.sampleRate infos['sampleStep'] = ptr.contents.sampleStep infos['frameLength'] = ptr.contents.frameLength infos['size'] = ptr.contents.size infos['parameters'] = dict( (k, v) for k, v in iterPtrDict(ptr.contents.parameters)) yc.engine_freeIOInfos(ptr) res[inputname] = infos yc.engine_freeIOList(iList) return res
def getOutputs(self): """ Get output metadata. For each output feature, you get the following metadata: :sampleRate: audio analysis samplerate :sampleStep: Number of audio samples between consecutive feature values :frameLength: Analysis frame size in number of audio samples :size: size the feature (or number of coefficients) :parameters: attached parameters. """ res = {} oList = yc.engine_getOutputList(self.ptr) for outputname in iterPtrList(oList): ptr = yc.engine_getOutputInfos(self.ptr, outputname) infos = {} if ptr: infos['sampleRate'] = ptr.contents.sampleRate infos['sampleStep'] = ptr.contents.sampleStep infos['frameLength'] = ptr.contents.frameLength infos['size'] = ptr.contents.size infos['parameters'] = dict( (k, v) for k, v in iterPtrDict(ptr.contents.parameters)) yc.engine_freeIOInfos(ptr) res[outputname] = infos yc.engine_freeIOList(oList) return res
def getOutputs(self): """ Get output metadata. For each output feature, you get the following metadata: :sampleRate: audio analysis samplerate :sampleStep: Number of audio samples between consecutive feature values :frameLength: Analysis frame size in number of audio samples :size: size the feature (or number of coefficients) :parameters: attached parameters. """ res = {} oList = yc.engine_getOutputList(self.ptr) for outputname in iterPtrList(oList): ptr = yc.engine_getOutputInfos(self.ptr, to_char(outputname)) infos = {} if ptr: infos['sampleRate'] = ptr.contents.sampleRate infos['sampleStep'] = ptr.contents.sampleStep infos['frameLength'] = ptr.contents.frameLength infos['size'] = ptr.contents.size infos['parameters'] = dict( (to_str(k), to_str(v)) for k, v in iterPtrDict(ptr.contents.parameters)) yc.engine_freeIOInfos(ptr) res[to_str(outputname)] = infos yc.engine_freeIOList(oList) return res
def getInputs(self): """ Get input metadata. Result format is the same as for :py:meth:`getOutputs` method, but the general case is that there is only one input named 'audio' and the sole relevant metadata are: :sampleRate: expected audio sampleRate :parameters: attached parameters Others fields should be set to 1. """ res = {} iList = yc.engine_getInputList(self.ptr) for inputname in iterPtrList(iList): ptr = yc.engine_getInputInfos(self.ptr, to_char(inputname)) infos = {} if ptr: infos['sampleRate'] = ptr.contents.sampleRate infos['sampleStep'] = ptr.contents.sampleStep infos['frameLength'] = ptr.contents.frameLength infos['size'] = ptr.contents.size infos['parameters'] = dict( (to_str(k), to_str(v)) for k, v in iterPtrDict(ptr.contents.parameters)) yc.engine_freeIOInfos(ptr) res[to_str(inputname)] = infos yc.engine_freeIOList(iList) return res
def readAllOutputs(self): """ Read all outputs. :return: dictionary with output name as key and numpy.array as value. """ res = {} oList = yc.engine_getOutputList(self.ptr) for o in iterPtrList(oList): res[o] = self.readOutput(o) return res
def readAllOutputs(self): """ Read all outputs. :return: dictionary with output name as key and numpy.array as value. """ res = {} oList = yc.engine_getOutputList(self.ptr) for o in iterPtrList(oList): res[to_str(o)] = self.readOutput(o) return res
def targetNodes(self): out = yc.dataflow_node_targets(self.ptr) res = [DataFlowNode(n) for n in iterPtrList(out)] yc.dataflow_freeNodeList(out) return res
def getComponentLibraries(self): out = yc.dataflow_getComponentLibraries(self.ptr) res = [l for l in iterPtrList(out)] yc.dataflow_freeComponentLibraries(out) return res
def finalNodes(self): out = yc.dataflow_finalNodes(self.ptr) res = [DataFlowNode(v) for v in iterPtrList(out)] yc.dataflow_freeNodeList(out) return res