vocalpy.SpectrogramMaker#

class vocalpy.SpectrogramMaker(callback: Callable | None = None, params: Mapping | Params | None = None)[source]#

Bases: object

Class that represents the step in a pipeline that makes spectrograms from audio.

Attributes:
callbackCallable

Callable that accepts a Sound and returns a Spectrogram. Default is vocalpy.spectrogram().

paramsdict

Parameters for making spectrograms. Passed as keyword arguments to callback.

Methods

make(sound[, parallelize])

Make spectrogram(s) from audio.

__init__(callback: Callable | None = None, params: Mapping | Params | None = None)[source]#

Methods

__init__([callback, params])

make(sound[, parallelize])

Make spectrogram(s) from audio.

make(sound: Sound | AudioFile | Sequence[Sound | AudioFile], parallelize: bool = True) Spectrogram | List[Spectrogram][source]#

Make spectrogram(s) from audio.

Makes the spectrograms with self.callback using the parameters self.params.

Takes as input vocalpy.Sound or vocalpy.AudioFile, or a sequence of either and returns either a vocalpy.Spectrogram (given a single vocalpy.Sound or vocalpy.AudioFile instance) or a list of vocalpy.Spectrogram instances (given a sequence).

Parameters:
sound: vocalpy.Sound, vocalpy.AudioFile, or a sequence of either

Source of audio used to make spectrograms.

Returns:
spectrogramvocalpy.Spectrogram or list of vocalpy.Spectrogram