FrameStepper

class ketos.audio.audio_loader.FrameStepper(duration, step=None, path=None, filename=None, pad=True)[source]

Generates selections with uniform length ‘duration’, with successive selections displaced by a fixed amount ‘step’ (If ‘step’ is not specified, it is set equal to ‘duration’.)

Args:
duration: float

Selection length in seconds.

step: float

Separation between consecutive selections in seconds. If None, the step size equals the selection length.

path: str

Path to folder containing .wav files. If None is specified, the current directory will be used.

filename: str or list(str)

Relative path to a single .wav file or a list of .wav files. Optional.

pad: bool

If True (default), the last segment is allowed to extend beyond the endpoint of the audio file.

Methods

get_file_durations()

Get the durations of the audio files associated with this instance.

get_file_paths([fullpath])

Get the paths to the audio files associated with this instance.

num()

Returns total number of selections.

reset()

Resets the selection generator to the beginning of the first file.

get_file_durations()[source]

Get the durations of the audio files associated with this instance.

Returns:
ans: list

List of file durations in seconds

get_file_paths(fullpath=True)[source]

Get the paths to the audio files associated with this instance.

Args:
fullpath: bool

Whether to return the full path (default) or only the filename.

Returns:
ans: list

List of file paths

num()[source]

Returns total number of selections.

Returns:
: int

Total number of selections.

reset()[source]

Resets the selection generator to the beginning of the first file.