捷徑

淡入淡出

class torchaudio.transforms.Fade(fade_in_len: int = 0, fade_out_len: int = 0, fade_shape: str = 'linear')[source]

在波形中加入淡入和/或淡出效果。

This feature supports the following devices: CPU, CUDA This API supports the following properties: Autograd, TorchScript
參數:
  • fade_in_len (int, 可選) – 淡入長度(時間幀)。 (預設值:0)

  • fade_out_len (int, 可選) – 淡出長度(時間影格)。(預設值:0

  • fade_shape (str, 可選) – 淡出形狀。必須是下列其中一種:“quarter_sine”、"half_sine""linear""logarithmic""exponential"。(預設值:"linear"

範例
>>> waveform, sample_rate = torchaudio.load("test.wav", normalize=True)
>>> transform = transforms.Fade(fade_in_len=sample_rate, fade_out_len=2 * sample_rate, fade_shape="linear")
>>> faded_waveform = transform(waveform)
使用 Fade 的教學課程
Music Source Separation with Hybrid Demucs

使用混合 Demucs 的音樂源分離

使用混合 Demucs 的音樂源分離
forward(waveform: Tensor) Tensor[source]
參數:

waveform (Tensor) – 音訊張量,維度為 (…, time)

回傳:

音訊張量,維度為 (…, time)

回傳型別:

Tensor

文件

取得 PyTorch 的完整開發者文件

檢視文件

教學

取得初學者和進階開發者的深入教學課程

檢視教學課程

資源

尋找開發資源並獲得您的問題解答

檢視資源