Core

AnalyzerResult

class timeside.core.analyzer.AnalyzerResult(data_mode='value', time_mode='framewise')[source]

Bases: timeside.core.analyzer.MetadataObject

Object that contains the metadata and parameters of an analyzer process

Parameters
data_modestr
data_mode describes the type of data :
  • ‘value’ for values

  • ‘label’ for label data see LabelMetadata

time_modestr
time_mode describes the correspondance between data values and time
  • ‘framewise’

  • ‘global’

  • ‘segment’

  • ‘event’

Returns
A new MetadataObject with the following attributes :
  • data_object : DataObject

  • id_metadata : IdMetadata

  • audio_metadata : AudioMetadata

  • frame_metadata : FrameMetadata

  • label_metadata : LabelMetadata

  • parameters : Parameters Object

Construct an Metadata object Abstract Class _default_value must be specified by

Metadata()

Returns
Metadata
as_dict(self)[source]
property data
property data_mode
property duration
static from_hdf5(h5group)[source]
static from_xml(xml_string)[source]
property id
property name
render(self)[source]

Render a matplotlib figure from the analyzer result

Return the figure, use fig.show() to display if neeeded

property time
property time_mode
to_hdf5(self, h5_file)[source]
to_json(self, output_file=None)[source]
to_xml(self)[source]
property unit

AnalyzerResultContainer

class timeside.core.analyzer.AnalyzerResultContainer(analyzer_results=None)[source]

Bases: dict

>>> import timeside
>>> from timeside.core.analyzer import Analyzer
>>> from timeside.core.tools.test_samples import samples
>>> wav_file = samples['sweep.mp3']
>>> d = timeside.core.get_processor('file_decoder')(wav_file)
>>> a = Analyzer()
>>> (d|a).run()
>>> a.new_result() 
AnalyzerResult(id_metadata=IdMetadata(id='analyzer', name='Generic analyzer', unit='', description='...', date='...', version='...', author='TimeSide', proc_uuid='...'), data_object=FrameValueObject(value=array([], dtype=float64), y_value=array([], dtype=float64), frame_metadata=FrameMetadata(samplerate=44100, blocksize=8192, stepsize=8192)), audio_metadata=AudioMetadata(uri='.../sweep.mp3', start=0.0, duration=8.0..., is_segment=False, sha1='...', channels=2, channelsManagement=''), parameters={})
>>> resContainer = timeside.core.analyzer.AnalyzerResultContainer()
add(self, analyzer_result, overwrite=False)[source]
from_hdf5(self, input_file)[source]
from_json(self, json_str)[source]
from_numpy(self, input_file)[source]
from_xml(self, xml_string)[source]
from_yaml(self, yaml_str)[source]
get_result_by_id(self, result_id)[source]
list_id(self)[source]
to_hdf5(self, output_file)[source]
to_json(self, output_file=None)[source]
to_numpy(self, output_file=None)[source]
to_xml(self, output_file=None)[source]
to_yaml(self, output_file=None)[source]