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_mode : str

data_mode describes the type of data :
  • ‘value’ for values
  • ‘label’ for label data see LabelMetadata

time_mode : str

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
as_dict()[source]
data
data_mode
duration
static from_hdf5(h5group)[source]
static from_xml(xml_string)[source]
id
name
render()[source]

Render a matplotlib figure from the analyzer result

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

time
time_mode
to_hdf5(h5_file)[source]
to_json(output_file=None)[source]
to_xml()[source]
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(analyzer_result, overwrite=False)[source]
from_hdf5(input_file)[source]
from_json(json_str)[source]
from_numpy(input_file)[source]
from_xml(xml_string)[source]
from_yaml(yaml_str)[source]
get_result_by_id(result_id)[source]
list_id()[source]
to_hdf5(output_file)[source]
to_json(output_file=None)[source]
to_numpy(output_file=None)[source]
to_xml(output_file=None)[source]
to_yaml(output_file=None)[source]