callcut.io.RecordingInfo🔗

class callcut.io.RecordingInfo(audio_path, annotation_path, duration_s, n_annotations)[source]🔗

Metadata about a recording for dataset construction.

This dataclass holds pre-computed information about a recording, avoiding repeated I/O operations when building datasets.

Parameters:
audio_pathPath

Path to the audio file.

annotation_pathPath

Path to the annotation CSV file.

duration_sfloat

Duration of the recording in seconds.

n_annotationsint

Number of annotated call intervals.

Methods

estimate_frames(extractor)

Estimate the number of feature frames for this recording.

estimate_windows(extractor, window_s, ...)

Estimate the number of training windows for this recording.

Examples

>>> from callcut.io import scan_recordings
>>> from pathlib import Path
>>>
>>> recordings = scan_recordings(list(Path("data/").glob("*.wav")))
>>> recordings[0].duration_s
45.2
>>> recordings[0].n_annotations
23
estimate_frames(extractor)[source]🔗

Estimate the number of feature frames for this recording.

Parameters:
extractorBaseExtractor

Feature extractor (used to get hop size).

Returns:
n_framesint

Estimated number of frames.

estimate_windows(extractor, window_s, window_hop_s)[source]🔗

Estimate the number of training windows for this recording.

Parameters:
extractorBaseExtractor

Feature extractor (used to convert seconds to frames).

window_sfloat

Window length in seconds.

window_hop_sfloat

Window hop in seconds.

Returns:
n_windowsint

Estimated number of training windows. Returns 0 if the recording is too short for even one window.