Track Processor

The ear.core.track_processor module can be used to render Track Specs. Users should create a TrackProcessorBase via TrackProcessor(), which can be used to extract a single channel of audio from a multi-channel bus.

MultiTrackProcessor allows for processing multiple tracks at once.

class ear.core.track_processor.TrackProcessorBase(track_spec)

Base class for processors which can be used to obtain samples for a single track spec given multi-track input samples (from a WAV file for example).

Use TrackProcessor() to create these.

process(sample_rate, input_samples)

Get the samples for one track spec.

Parameters
  • sample_rate (int) – sample rate of input/output samples in Hz

  • input_samples (array of (n, c) floats) – c channels of n input samples

Returns

n samples for track_spec.

Return type

array of (n,) floats

ear.core.track_processor.TrackProcessor(track_spec)

Build a processor to render a single track spec.

Parameters

track_spec (TrackSpec) – Track spec to render.

Returns

processor to obtain samples for track_spec

Return type

TrackProcessorBase

class ear.core.track_processor.MultiTrackProcessor(track_specs)

A processor that renders multiple track specs into a single array given multi-track input samples (from a WAV file for example).

process(sample_rate, input_samples)

Get the samples for all track specs.

Parameters
  • sample_rate (int) – sample rate of input/output samples in Hz

  • input_samples (array of (n, c) floats) – c channels of n input samples

Returns

n samples for each of the m track_specs.

Return type

array of (n, m) floats