Shortcuts

torchaudio.functional.gain

torchaudio.functional.gain(waveform: Tensor, gain_db: float = 1.0) Tensor[source]

Apply amplification or attenuation to the whole waveform.

This feature supports the following devices: CPU, CUDA This API supports the following properties: Autograd, TorchScript
Parameters:
  • waveform (Tensor) – Tensor of audio of dimension (…, time).

  • gain_db (float, optional) Gain adjustment in decibels (dB) – 1.0).

Returns:

the whole waveform amplified by gain_db.

Return type:

Tensor

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources