cutcutcodec.core.classes.layout.Layout

class cutcutcodec.core.classes.layout.Layout(name: str | Integral)[source]

An audio profile.

Attributes

channelstuple[tuple[str, str], …]

Each audio channel (readonly) as an ordered dict with: The canonical name of the audio channel and a human description of the audio channel.

namestr

The canonical name of the audio profile (readonly).

Initialise and create the class.

Parameters

namestr or numbers.Integral

The canonical name of the audio profile. If an integer is provide, a default profile is assigned.

property channels: tuple[tuple[str, str], ...]

Return the description of each channels.

Examples

>>> from pprint import pprint
>>> from cutcutcodec.core.classes.layout import Layout
>>> Layout("stereo").channels
(('fl', 'front left'), ('fr', 'front right'))
>>> pprint(Layout("5.1").channels)
(('fl', 'front left'),
 ('fr', 'front right'),
 ('fc', 'front center'),
 ('lfe', 'low frequency'),
 ('bl', 'back left'),
 ('br', 'back right'))
>>>
property name: str

Return the canonical name of the audio profile.

Examples

>>> from cutcutcodec.core.classes.layout import Layout
>>> Layout(2).name
'stereo'
>>>