快捷方式

漸變

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, optional) – 淡入時長 (時間幀)。 (預設值: 0)

  • fade_out_len (int, optional) – 淡出時長 (時間幀)。 (預設值: 0)

  • fade_shape (str, optional) – 淡變形狀。必須是以下之一:“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

使用 Hybrid Demucs 進行音樂源分離

使用 Hybrid Demucs 進行音樂源分離
forward(waveform: Tensor) Tensor[source]
引數:

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

返回值:

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

返回值型別:

Tensor


© 版權所有 2024, Torchaudio 貢獻者。

使用 Sphinx 構建,主題由 Read the Docs 提供。

文件

訪問 PyTorch 的完整開發者文件

檢視文件

教程

獲取針對初學者和高階開發者的深度教程

檢視教程

資源

查詢開發資源並獲得問題解答

檢視資源