nicetoolbox.detectors.data_handlers.audio_handler.AudioDataHandler

class nicetoolbox.detectors.data_handlers.audio_handler.AudioDataHandler(io: SequenceIO, sequence_context: SequenceRuntimeConfig, audio_start_ms: float, audio_length_ms: float, tracks_config: dict[str, nicetoolbox.configs.schemas.dataset_properties.AudioTrackConfig])[source]

Bases: BaseModalityHandler

Handles audio data extraction and organization.

Uses the track configuration from dataset_properties to determine which audio streams to extract and from where.

Methods

get_recipe

Build audio input recipe with full file paths + time range.

prepare

Prepare audio data based on track configuration.

Attributes

is_available

Whether data for this modality was successfully prepared.

modality_name

Return the name of this modality (e.g., 'video', 'audio').

streams

get_recipe() AudioInputRecipe[source]

Build audio input recipe with full file paths + time range.

property is_available: bool

Whether data for this modality was successfully prepared.

property modality_name: str

Return the name of this modality (e.g., ‘video’, ‘audio’).

prepare() None[source]

Prepare audio data based on track configuration.

Audio is always extracted in FULL. Already-extracted files are reused. Sets self._available = True if at least one track was prepared.