快捷方式

torchaudio.functional.flanger

torchaudio.functional.flanger(waveform: Tensor, sample_rate: int, delay: float = 0.0, depth: float = 2.0, regen: float = 0.0, width: float = 71.0, speed: float = 0.5, phase: float = 25.0, modulation: str = 'sinusoidal', interpolation: str = 'linear') Tensor[源代码]

对音频应用镶边效果 (flanger effect)。类似于 SoX 实现。

This feature supports the following devices: CPU, CUDA This API supports the following properties: Autograd, TorchScript
参数:
  • waveform (Tensor) – 音频波形,维度为 (…, channel, time)。最多允许 4 个通道

  • sample_rate ([*int*](https://docs.pythonlang.cn/3/library/functions.html#int "(in Python v3.13)")) – 波形的采样率,例如 44100 (Hz)

  • delay ([*float*](https://docs.pythonlang.cn/3/library/functions.html#float "(in Python v3.13)")*, 可选*) – 期望的延迟,单位毫秒(ms)。允许的值范围是 0 到 30

  • depth ([*float*](https://docs.pythonlang.cn/3/library/functions.html#float "(in Python v3.13)")*, 可选*) – 期望的延迟深度,单位毫秒(ms)。允许的值范围是 0 到 10

  • regen ([*float*](https://docs.pythonlang.cn/3/library/functions.html#float "(in Python v3.13)")*, 可选*) – 期望的再生(反馈增益),单位 dB。允许的值范围是 -95 到 95

  • width ([*float*](https://docs.pythonlang.cn/3/library/functions.html#float "(in Python v3.13)")*, 可选*) – 期望的宽度(延迟增益),单位 dB。允许的值范围是 0 到 100

  • speed ([*float*](https://docs.pythonlang.cn/3/library/functions.html#float "(in Python v3.13)")*, 可选*) – 调制速度,单位 Hz。允许的值范围是 0.1 到 10

  • phase ([*float*](https://docs.pythonlang.cn/3/library/functions.html#float "(in Python v3.13)")*, 可选*) – 多通道的相位偏移百分比。允许的值范围是 0 到 100

  • modulation ([*str*](https://docs.pythonlang.cn/3/library/stdtypes.html#str "(in Python v3.13)")*, 可选*) – 使用“sinusoidal”(正弦波)或“triangular”(三角波)调制。(默认值: sinusoidal)

  • interpolation ([*str*](https://docs.pythonlang.cn/3/library/stdtypes.html#str "(in Python v3.13)")*, 可选*) – 延迟线插值使用“linear”(线性)或“quadratic”(二次)方法。(默认值: linear)

返回:

波形,维度为 (…, channel, time)

返回类型:

Tensor

参考

文档

访问 PyTorch 的全面开发者文档

查看文档

教程

获取面向初学者和高级开发者的深度教程

查看教程

资源

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

查看资源