vocalpy.SpectrogramMaker#
- class vocalpy.SpectrogramMaker(callback: Callable | None = None, params: Mapping | Params | None = None)[source]#
Bases:
objectClass that represents the step in a pipeline that makes spectrograms from audio.
- Attributes:
- callbackCallable
Callable that accepts a
Soundand returns aSpectrogram. Default isvocalpy.spectrogram().- paramsdict
Parameters for making spectrograms. Passed as keyword arguments to
callback.
Methods
make(sound[, parallelize])Make spectrogram(s) from audio.
Methods
- 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.Soundorvocalpy.AudioFile, or a sequence of either and returns either avocalpy.Spectrogram(given a singlevocalpy.Soundorvocalpy.AudioFileinstance) or a list ofvocalpy.Spectrograminstances (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