Metadata Input¶
The data structures in the ear.core.metadata_input module act as the main
interface between the core renderer classes for each type, and the wider EAR
system, or other systems which want to render audio using the EAR.
The data structures are not ADM: they are essentially a simplified view of ADM data containing only the parts required for rendering: an association between some input audio tracks, and streams of time-varying metadata to apply to them.
The input to a renderer is a list of RenderingItem objects, which are
specialised for each ADM type (ObjectRenderingItem,
DirectSpeakersRenderingItem etc.). Each rendering item contains:
A pointer to some audio data, through a
TrackSpecobject. This generally says something like “track 2 of the input audio stream”, but can also contain a more complex mapping for Matrix types, or reference a silent input.In the case of HOA where multiple tracks are rendered together, multiple track specs are given.
See Track Specs.
A source of time-varying metadata, provided by a
MetadataSource. This can be used to access a sequence ofTypeMetadataobjects, which are again sub-classed for each ADM type (ObjectTypeMetadata,DirectSpeakersTypeMetadataetc.).TypeMetadatasub-classes generally contain a pointer to the corresponding audioBlockFormat data, as well as any extra data from outside the audioBlockFormat which is needed for rendering.Extra data (generally
ImportanceDataandADMPath) which is not required for rendering, but may be useful for debugging, or uses other than straightforward rendering (for example only rendering some sub-set of an ADM file).
The available classes and their inheritance relationships are shown below:

Overall Structure¶
- class ear.core.metadata_input.RenderingItem¶
Base class for *RenderingItem classes; these should represent an item to be rendered, combining a MetadataSource that produces a sequence of TypeMetadata objects, and some indices into the tracks that this metadata applies to.
- class ear.core.metadata_input.TypeMetadata¶
Base class for *TypeMetadata classes; these should represent all the parameters needed to render some set of audio channels within some time bounds.
- class ear.core.metadata_input.MetadataSource¶
A source of metadata for some input channels.
- get_next_block()¶
Get the next metadata block, if one is available.
- Return type
Optional[ear.core.metadata_input.TypeMetadata]
Track Specs¶
To render track specs, see ear.core.track_processor.TrackProcessor() and
ear.core.track_processor.MultiTrackProcessor.
- class ear.core.metadata_input.TrackSpec¶
Represents a method for obtaining audio samples to be processed given multi-track input samples (from a WAV file for example).
This is used to abstract over regular track references, silent channels and matrix channels, but could also be used for coded audio, fancy containers etc.
- class ear.core.metadata_input.DirectTrackSpec(track_index)¶
Bases:
ear.core.metadata_input.TrackSpecTrack obtained directly from the input audio stream.
- class ear.core.metadata_input.SilentTrackSpec¶
Bases:
ear.core.metadata_input.TrackSpecA track whose samples are always 0.
- class ear.core.metadata_input.MatrixCoefficientTrackSpec(input_track, coefficient)¶
Bases:
ear.core.metadata_input.TrackSpecTrack derived from a single channel and a matrix coefficient.
- input_track¶
track spec to obtain samples from before they are processed by parameters in coefficient.
- Type
- coefficient¶
matrix parameters to apply; inputChannelFormat should be ignored.
- Type
- class ear.core.metadata_input.MixTrackSpec(input_tracks)¶
Bases:
ear.core.metadata_input.TrackSpecTrack that is a mix of some other tracks.
- input_tracks¶
list of input tracks to mix
- Type
list of TrackSpec
Objects¶
- class ear.core.metadata_input.ObjectTypeMetadata(block_format, extra_data=NOTHING)¶
Bases:
ear.core.metadata_input.TypeMetadataTypeMetadata for typeDefinition=”Objects”
- block_format¶
Block format.
- class ear.core.metadata_input.ObjectRenderingItem(track_spec, metadata_source, importance=NOTHING, adm_path=None)¶
Bases:
ear.core.metadata_input.RenderingItemRenderingItem for typeDefinition=”Objects”
- metadata_source¶
Source of ObjectTypeMetadata objects.
- Type
- importance¶
Importance data for this item.
- Type
Direct Speakers¶
- class ear.core.metadata_input.DirectSpeakersTypeMetadata(block_format, audioPackFormats=None, extra_data=NOTHING)¶
Bases:
ear.core.metadata_input.TypeMetadataTypeMetadata for typeDefinition=”DirectSpeakers”
- block_format¶
Block format.
- class ear.core.metadata_input.DirectSpeakersRenderingItem(track_spec, metadata_source, importance=NOTHING, adm_path=None)¶
Bases:
ear.core.metadata_input.RenderingItemRenderingItem for typeDefinition=”DirectSpeakers”
- metadata_source¶
Source of DirectSpeakersTypeMetadata objects.
- Type
- importance¶
Importance data for this item.
- Type
HOA¶
- class ear.core.metadata_input.HOATypeMetadata(orders, degrees, normalization, nfcRefDist=None, screenRef=False, rtime=None, duration=None, extra_data=NOTHING)¶
Bases:
ear.core.metadata_input.TypeMetadataTypeMetadata for typeDefinition=”HOA”
- orders¶
Order for each input channel.
- Type
list of int
- degrees¶
Degree for each channel.
- Type
list of int
- rtime¶
Start time of block.
- Type
- duration¶
Duration of block.
- Type
- class ear.core.metadata_input.HOARenderingItem(track_specs, metadata_source, importances=None, adm_paths=None)¶
Bases:
ear.core.metadata_input.RenderingItemRenderingItem for typeDefinition=”HOA”
- metadata_source¶
Source of HOATypeMetadata objects; will usually contain only one object.
- Type
- importances¶
Importance data for each track.
- Type
Optional[list[ImportanceData]]