drumscript.audio_processor.feature_extractor.extract_features_for_onsets¶
- extract_features_for_onsets(audio_path: ndarray, sr: int, onset_times: list[float]) list[dict[str, Any]][source]¶
Slices an audio array around each onset time and extracts features for each slice.
- Parameters:
audio_path (np.ndarray) – Full audio array.
sr (int) – Sampling rate.
onset_times (List[float]) – List of onset timestamps.
- Returns:
List of feature dictionaries.
- Return type:
List[Dict[str, Any]]