How to save audio as .wav from waveform and sample rate?

I have a speech1.wav . I have applied some effects on the waveform of this audio file and I have a new waveform and sample rate. How do I create a new speech2.wav file using this new waveform and sample rate? Please help!

From the torchaudio tutorial Audio I/O — Torchaudio 0.11.0 documentation

To save audio data in formats interpretable by common applications, you can use