The current doc for torchaudio.transforms.Vol just says "Adjust volume of waveform." but it also clamps the output using torch.clamp(waveform, -1, 1) which can be hard to realise and debug (in my case, I have millions of audio files and around 10% of them had enough dynamic range to trigger this clipping, making it harder to reproduce, but still enough files to cause audio quality issues and disrupt training stability).
Suggest a potential alternative/fix
I would suggest adding a warning to the method that prints once if an output waveform has samples that will be clamped and updating the torchaudio doc to make it clear that the function clamps the output.
📚 The doc issue
https://pytorch.org/audio/stable/generated/torchaudio.transforms.Vol.html
The current doc for
torchaudio.transforms.Vol
just says "Adjust volume of waveform." but it also clamps the output usingtorch.clamp(waveform, -1, 1)
which can be hard to realise and debug (in my case, I have millions of audio files and around 10% of them had enough dynamic range to trigger this clipping, making it harder to reproduce, but still enough files to cause audio quality issues and disrupt training stability).Suggest a potential alternative/fix
I would suggest adding a warning to the method that prints once if an output waveform has samples that will be clamped and updating the torchaudio doc to make it clear that the function clamps the output.