dcase_util.containers.AudioContainer.frames

AudioContainer.frames(frame_length=None, hop_length=None, frame_length_seconds=None, hop_length_seconds=None)[source]

Slice audio into overlapping frames.

Parameters
frame_lengthint, optional

Frame length in samples. Set either frame_length or frame_length_seconds. Default value None

hop_lengthint, optional

Frame hop length in samples. Set either hop_length or hop_length_seconds. Default value None

frame_length_secondsfloat, optional

Frame length in seconds, converted into samples based on sampling rate. Default value None

hop_length_seconds: float, optional

Frame hop length in seconds, converted into samples based on sampling rate. Default value None

Returns
numpy.ndarray
Raises
ValueError:

No frame_length and no frame_length_seconds given. No hop_length and no hop_length_seconds given.