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 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.Sound
orvocalpy.AudioFile
, or a sequence of either and returns either avocalpy.Spectrogram
(given a singlevocalpy.Sound
orvocalpy.AudioFile
instance) or a list ofvocalpy.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