快捷方式

渐变

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 的完整开发者文档

查看文档

教程

获取针对初学者和高级开发者的深度教程

查看教程

资源

查找开发资源并获得问题解答

查看资源