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:
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:
- extractor
BaseExtractor Feature extractor (used to get hop size).
- extractor
- Returns:
- n_frames
int Estimated number of frames.
- n_frames
- estimate_windows(extractor, window_s, window_hop_s)[source]🔗
Estimate the number of training windows for this recording.
- Parameters:
- extractor
BaseExtractor Feature extractor (used to convert seconds to frames).
- window_s
float Window length in seconds.
- window_hop_s
float Window hop in seconds.
- extractor
- Returns:
- n_windows
int Estimated number of training windows. Returns 0 if the recording is too short for even one window.
- n_windows