FloatWaveform.from_frames_of_silence()

static FloatWaveform.from_frames_of_silence(frame_rate_hz, num_channels, num_frames)

Creates a silent waveform of num_frames frames.

Example

Creating 1000 frames of silence (in stereo).

>>> from babycat import FloatWaveform
>>> FloatWaveform.from_frames_of_silence(
...    frame_rate_hz=44100,
...    num_channels=2,
...    num_frames=1000,
... )
<babycat.FloatWaveform: 1000 frames, 2 channels, 44100 hz>
Parameters
  • frame_rate_hz (int) – The frame rate to set for this silent audio waveform.

  • num_channels (int) – The number of channels to set.

  • num_frames (int) – The number of frames to set.

Returns

A waveform representing silence.

Return type

FloatWaveform