Speed¶
- class torchaudio.transforms.Speed(orig_freq, factor)[source]¶
Adjusts waveform speed.
- Parameters:
- forward(waveform, lengths: Optional[Tensor] = None) Tuple[Tensor, Optional[Tensor]] [source]¶
- Parameters:
waveform (torch.Tensor) – Input signals, with shape (…, time).
lengths (torch.Tensor or None, optional) – Valid lengths of signals in
waveform
, with shape (…). IfNone
, all elements inwaveform
are treated as valid. (Default:None
)
- Returns:
- torch.Tensor
Speed-adjusted waveform, with shape (…, new_time).
- torch.Tensor or None
If
lengths
is notNone
, valid lengths of signals in speed-adjusted waveform, with shape (…); otherwise,None
.
- Return type:
(torch.Tensor, torch.Tensor or None)