Vol¶
- class torchaudio.transforms.Vol(gain: float, gain_type: str = 'amplitude')[source]¶
- Adjust volume of waveform. - Parameters:
- gain (float) – Interpreted according to the given gain_type: If - gain_type=- amplitude,- gainis a positive amplitude ratio. If- gain_type=- power,- gainis a power (voltage squared). If- gain_type=- db,- gainis in decibels.
- gain_type (str, optional) – Type of gain. One of: - amplitude,- power,- db(Default:- amplitude)
 
 - Example
- >>> waveform, sample_rate = torchaudio.load("test.wav", normalize=True) >>> transform = transforms.Vol(gain=0.5, gain_type="amplitude") >>> quieter_waveform = transform(waveform)