mindspore/docs/api/api_python/dataset_audio/mindspore.dataset.audio.Fla...

41 lines
2.7 KiB
ReStructuredText
Raw Normal View History

mindspore.dataset.audio.Flanger
===============================
.. py:class:: mindspore.dataset.audio.Flanger(sample_rate, delay=0.0, depth=2.0, regen=0.0, width=71.0, speed=0.5, phase=25.0, modulation=Modulation.SINUSOIDAL, interpolation=Interpolation.LINEAR)
给音频施加镶边效果。
接口实现方式类似于 `SoX库 <http://sox.sourceforge.net/sox.html>`_
参数:
- **sample_rate** (int) - 波形采样频率例如44100 (Hz)。
- **delay** (float, 可选) - 期望的延迟时间,单位为毫秒,取值范围为[0, 30]。默认值0.0。
- **depth** (float, 可选) - 期望的延迟深度,单位为毫秒,取值范围为[0, 10]。默认值2.0。
- **regen** (float, 可选) - 期望的反馈增益单位为dB取值范围为[-95, 95]。默认值0.0。
- **width** (float, 可选) - 期望的延迟增益单位为dB取值范围为[0, 100]。默认值71.0。
- **speed** (float, 可选) - 调制速度单位为Hz取值范围为[0.1, 10]。默认值0.5。
- **phase** (float, 可选) - 各通道的相位偏移百分比,取值范围为[0, 100]。默认值25.0。
- **modulation** (Modulation, 可选) - 调制方法可为Modulation.SINUSOIDAL或Modulation.TRIANGULAR。
默认值Modulation.SINUSOIDAL。
- **interpolation** (Interpolation, 可选) - 插值方法可为Interpolation.LINEAR或Interpolation.QUADRATIC。
默认值Interpolation.LINEAR。
异常:
- **TypeError** - 当 `sample_rate` 的类型不为int。
- **ValueError** - 当 `sample_rate` 为零。
- **TypeError** - 当 `delay` 的类型不为float。
- **ValueError** - 当 `delay` 取值不在[0, 30]范围内。
- **TypeError** - 当 `depth` 的类型不为float。
- **ValueError** - 当 `depth` 取值不在[0, 10]范围内。
- **TypeError** - 当 `regen` 的类型不为float。
- **ValueError** - 当 `regen` 取值不在[-95, 95]范围内。
- **TypeError** - 当 `width` 的类型不为float。
- **ValueError** - 当 `width` 取值不在[0, 100]范围内。
- **TypeError** - 当 `speed` 的类型不为float。
- **ValueError** - 当 `speed` 取值不在[0.1, 10]范围内。
- **TypeError** - 当 `phase` 的类型不为float。
- **ValueError** - 当 `phase` 取值不在[0, 100]范围内。
- **TypeError** - 当 `modulation` 的类型不为 :class:`mindspore.dataset.audio.Modulation`
- **TypeError** - 当 `interpolation` 的类型不为 :class:`mindspore.dataset.audio.Interpolation`
- **RuntimeError** - 当输入音频的shape不为<..., channel, time>。