本文整理汇总了Java中android.media.audiofx.Equalizer.setBandLevel方法的典型用法代码示例。如果您正苦于以下问题:Java Equalizer.setBandLevel方法的具体用法?Java Equalizer.setBandLevel怎么用?Java Equalizer.setBandLevel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.media.audiofx.Equalizer
的用法示例。
在下文中一共展示了Equalizer.setBandLevel方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: apply
import android.media.audiofx.Equalizer; //导入方法依赖的package包/类
public void apply(Equalizer equalizer)
{
for (short i = 0; i < bandLevels.length; i++)
{
equalizer.setBandLevel(i, bandLevels[i]);
}
if (preset >= 0 && preset < equalizer.getNumberOfPresets())
{
equalizer.usePreset(preset);
}
equalizer.setEnabled(enabled);
}
示例2: apply
import android.media.audiofx.Equalizer; //导入方法依赖的package包/类
public void apply(Equalizer equalizer, BassBoost boost, LoudnessEnhancerController loudnessController) {
for (short i = 0; i < bandLevels.length; i++) {
equalizer.setBandLevel(i, bandLevels[i]);
}
equalizer.setEnabled(enabled);
if(bass != 0) {
boost.setEnabled(true);
boost.setStrength(bass);
}
if(loudness != 0) {
loudnessController.enable();
loudnessController.setGain(loudness);
}
}
示例3: apply
import android.media.audiofx.Equalizer; //导入方法依赖的package包/类
public void apply(Equalizer equalizer) {
for (short i = 0; i < bandLevels.length; i++) {
equalizer.setBandLevel(i, bandLevels[i]);
}
if (preset >= 0 && preset < equalizer.getNumberOfPresets()) {
equalizer.usePreset(preset);
}
equalizer.setEnabled(enabled);
}
示例4: setEqualizer
import android.media.audiofx.Equalizer; //导入方法依赖的package包/类
private void setEqualizer(Equalizer e) {
SpeakerBoost.log("setEqualizer "+boostValue);
if (e == null)
return;
short v = (short)( (boostValue * rangeHigh + NOMINAL_RANGE_HIGH/2) / NOMINAL_RANGE_HIGH );
if (v < 0)
v = 0;
if (v > rangeHigh)
v = rangeHigh;
if (v != 0) {
e.setEnabled(true);
for (short i=0; i<bands; i++) {
short adj = v;
if (shape) {
int hz = e.getCenterFreq(i)/1000;
if (hz < 150)
adj = 0;
else if (hz < 250)
adj = (short)(v/2);
else if (hz > 8000)
adj = (short)(3*(int)v/4);
}
SpeakerBoost.log("boost "+i+" ("+(eq.getCenterFreq(i)/1000)+"hz) to "+adj);
SpeakerBoost.log("previous value "+eq.getBandLevel(i));
try {
e.setBandLevel(i, (short) adj);
}
catch (Exception exc) {
SpeakerBoost.log("Error "+exc);
}
}
}
else {
e.setEnabled(false);
}
}