Most visited

Recently visited

Added in API level 19

LoudnessEnhancer

public class LoudnessEnhancer
extends AudioEffect

java.lang.Object
   ↳ android.media.audiofx.AudioEffect
     ↳ android.media.audiofx.LoudnessEnhancer


响度增强器是增加音频响度的音频效果。 该处理由目标增益值进行参数化,该目标增益值确定音频信号将被放大的最大量; 在平台支持的样本范围之外放大的信号被压缩。 应用程序创建一个LoudnessEnhancer对象来在音频框架中实例化和控制此音频效果。 要将LoudnessEnhancer附加到特定的AudioTrack或MediaPlayer,请在构建特效时指定此AudioTrack或MediaPlayer的音频会话ID(请参阅getAudioSessionId()getAudioSessionId() )。

Summary

Constants

int PARAM_TARGET_GAIN_MB

应用于信号处理的最大增益。

Inherited constants

From class android.media.audiofx.AudioEffect

Inherited fields

From class android.media.audiofx.AudioEffect

Public constructors

LoudnessEnhancer(int audioSession)

类构造函数。

Public methods

float getTargetGain()

返回目标收益。

void setTargetGain(int gainmB)

设置音频效果的目标增益。

Inherited methods

From class android.media.audiofx.AudioEffect
From class java.lang.Object

Constants

PARAM_TARGET_GAIN_MB

Added in API level 19
int PARAM_TARGET_GAIN_MB

应用于信号处理的最大增益。 它以毫巴(100mB = 1dB)表示,其中0mB对应于无放大。

常量值:0(0x00000000)

Public constructors

LoudnessEnhancer

Added in API level 19
LoudnessEnhancer (int audioSession)

类构造函数。

Parameters
audioSession int: system-wide unique audio session identifier. The LoudnessEnhancer will be attached to the MediaPlayer or AudioTrack in the same audio session.
Throws
java.lang.IllegalStateException
java.lang.IllegalArgumentException
java.lang.UnsupportedOperationException
RuntimeException
IllegalStateException
IllegalArgumentException
UnsupportedOperationException

Public methods

getTargetGain

Added in API level 19
float getTargetGain ()

返回目标收益。

Returns
float the effect target gain expressed in mB.
Throws
IllegalStateException
IllegalArgumentException
UnsupportedOperationException
IllegalStateException
IllegalArgumentException

setTargetGain

Added in API level 19
void setTargetGain (int gainmB)

设置音频效果的目标增益。 目标增益是启用效果时样本值将被放大的最大值。

Parameters
gainmB int: the effect target gain expressed in mB. 0mB corresponds to no amplification.
Throws
IllegalStateException
IllegalArgumentException
UnsupportedOperationException
IllegalStateException
IllegalArgumentException

Hooray!