nemo_curator.stages.audio.tagging.utils

View as Markdown

Module Contents

Functions

NameDescription
add_non_speaker_segmentsAdd non-speaker segments to the segments list with speaker id ‘no-speaker’.

API

nemo_curator.stages.audio.tagging.utils.add_non_speaker_segments(
segments: list[dict[str, typing.Any]],
audio_duration: float,
max_length: float | None = None
) -> None

Add non-speaker segments to the segments list with speaker id ‘no-speaker’.

If max_length is provided, splits non-speaker regions into chunks of that length; otherwise adds one segment per gap. Modifies segments in-place and sorts by start time.

Parameters:

segments
list[dict[str, Any]]

List of segment dicts with ‘start’ and ‘end’.

audio_duration
float

Total audio duration in seconds.

max_length
float | NoneDefaults to None

Optional max length for each non-speaker segment.