!24271 [assistant][Vol]Enumeration comments supplement

Merge pull request !24271 from QingfengLi/code_docs_vol_enums
This commit is contained in:
i-robot 2021-09-30 02:07:28 +00:00 committed by Gitee
commit 45b79cc4ac
2 changed files with 30 additions and 4 deletions

View File

@ -758,7 +758,7 @@ class Vol(AudioTensorOperation):
If gain_type = amplitude, gain stands for nonnegative amplitude ratio.
If gain_type = power, gain stands for power.
If gain_type = db, gain stands for decibels.
gain_type (ScaleType, optional): Type of gain, contains the following three enumeration values
gain_type (GainType, optional): Type of gain, contains the following three enumeration values
GainType.AMPLITUDE, GainType.POWER and GainType.DB (default=GainType.AMPLITUDE).
Examples:

View File

@ -20,7 +20,18 @@ from enum import Enum
class FadeShape(str, Enum):
"""Fade Shape"""
"""
Fade Shapes.
Possible enumeration values are: FadeShape.EXPONENTIAL, FadeShape.HALFSINE, FadeShape.LINEAR,
FadeShape.LOGARITHMIC, FadeShape.QUARTERSINE.
- FadeShape.EXPONENTIAL: means the fade shape is exponential mode.
- FadeShape.HALFSINE: means the fade shape is half_sine mode.
- FadeShape.LINEAR: means the fade shape is linear mode.
- FadeShape.LOGARITHMIC: means the fade shape is logarithmic mode.
- FadeShape.QUARTERSINE: means the fade shape is quarter_sine mode.
"""
LINEAR: str = "linear"
EXPONENTIAL: str = "exponential"
LOGARITHMIC: str = "logarithmic"
@ -29,13 +40,28 @@ class FadeShape(str, Enum):
class GainType(str, Enum):
"""Gain Type"""
""""
Gain Types.
Possible enumeration values are: GainType.AMPLITUDE, GainType.DB, GainType.POWER.
- GainType.AMPLITUDE: means input gain type is amplitude.
- GainType.DB: means input gain type is decibel.
- GainType.POWER: means input gain type is power.
"""
POWER: str = "power"
AMPLITUDE: str = "amplitude"
DB: str = "db"
class ScaleType(str, Enum):
"""Scale Type"""
"""
Scale Types.
Possible enumeration values are: ScaleType.MAGNITUDE, ScaleType.POWER.
- ScaleType.MAGNITUDE: means the scale of input audio is magnitude.
- ScaleType.POWER: means the scale of input audio is power.
"""
POWER: str = "power"
MAGNITUDE: str = "magnitude"