medkit.audio.preprocessing.downmixer#

Classes#

Downmixer

Downmixing operation converting multichannel audio signals to mono.

Module Contents#

class medkit.audio.preprocessing.downmixer.Downmixer(output_label: str, prevent_clipping: bool = True, uid: str | None = None)#

Bases: medkit.core.audio.PreprocessingOperation

Downmixing operation converting multichannel audio signals to mono.

Parameters:
output_labelstr

Label of output downmixed segments.

prevent_clippingbool, default=True

If True, normalize downmixed signals by number of channels to prevent clipping.

uidstr, optional

Identifier of the downmixer.

init_args#
output_label#
prevent_clipping#
run(segments: list[medkit.core.audio.Segment]) list[medkit.core.audio.Segment]#

Return a downmixed segment for each segment in segments.

Parameters:
segmentslist of Segment

Audio segments to downmix.

Returns:
list of Segment

Downmixed segments, one per segment in segments.

_downmix_segment(segment: medkit.core.audio.Segment) medkit.core.audio.Segment#