In [1]:
import waloviz as wv
wv.extension()
In [2]:
import torch
def wav_curve(wav, sr):
return wav
def envelope_curve(wav, sr):
return torch.nn.functional.max_pool1d(wav, kernel_size=101, stride=50, padding=50)
wv.Audio(
"https://www2.cs.uic.edu/~i101/SoundFiles/CantinaBand3.wav",
{"wav": wav_curve, "envelope": envelope_curve, "random": torch.randn(100)/20},
minimal=True,
)
Out[2]: