music.silence

music.silence(duration=1.0, sample_rate=44100)[source]

Generate a silence of specified length.

Parameters:
durationint, optional

How many seconds will silence last, by default 1

sample_rateint, optional

The sample rate to use, by default 44100

Returns:
array

An array with no sound

Parameters:
Return type:

NDArray[float64]

Examples

>>> gap = silence(duration=0.25)
>>> len(gap), float(abs(gap).max())
(11025, 0.0)
>>> phrase = horizontal_stack(note(220, 0.2), silence(0.1), note(330, 0.2))