本文整理汇总了Java中android.media.audiofx.Virtualizer类的典型用法代码示例。如果您正苦于以下问题:Java Virtualizer类的具体用法?Java Virtualizer怎么用?Java Virtualizer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Virtualizer类属于android.media.audiofx包,在下文中一共展示了Virtualizer类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: release
import android.media.audiofx.Virtualizer; //导入依赖的package包/类
private void release(AudioEffect effect) {
if (null != effect) {
effect.setControlStatusListener(null);
effect.setEnableStatusListener(null);
if (effect instanceof Equalizer) {
((Equalizer) effect).setParameterListener(null);
} else if (effect instanceof BassBoost) {
((BassBoost) effect).setParameterListener(null);
} else if (effect instanceof Virtualizer) {
((Virtualizer) effect).setParameterListener(null);
}
effect.release();
}
}
示例2: EqualizerHelper
import android.media.audiofx.Virtualizer; //导入依赖的package包/类
public EqualizerHelper(int audioSessionId1, boolean equalizerEnabled) throws RuntimeException {
mEqualizer = new Equalizer(0, audioSessionId1);
mEqualizer.setEnabled(equalizerEnabled);
mVirtualizer = new Virtualizer(0, audioSessionId1);
mVirtualizer.setEnabled(equalizerEnabled);
mBassBoost = new BassBoost(0, audioSessionId1);
mBassBoost.setEnabled(equalizerEnabled);
mPresetReverb = new PresetReverb(0, audioSessionId1);
mPresetReverb.setEnabled(equalizerEnabled);
}
示例3: initVirtualizer
import android.media.audiofx.Virtualizer; //导入依赖的package包/类
public static void initVirtualizer(int audioID) {
EndVirtual();
try {
virtualizer = new Virtualizer(0, audioID);
short str = (short) Extras.getInstance().saveEq().getInt(VIRTUAL_BOOST, 0);
if (str > 0) {
setVirtualizerStrength(str);
}else {
setVirtualizerStrength((short) 0);
}
} catch (Exception e) {
e.printStackTrace();
}
}
示例4: onCreate
import android.media.audiofx.Virtualizer; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
Log.d(AppConstants.LOG_TAG, "onCreate");
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_hello_audioeffect);
setUpViews();
playSong();
mBassBoost = new BassBoost(0, mMediaPlayer.getAudioSessionId());
mBassBoost.setEnabled(true);
mVirtualizer = new Virtualizer(0, mMediaPlayer.getAudioSessionId());
mVirtualizer.setEnabled(true);
mAudioManager = (AudioManager) getSystemService(AUDIO_SERVICE);
mMaxVolume = mAudioManager
.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
Log.d(AppConstants.LOG_TAG, "Max Volume: " + mMaxVolume);
mVolumeBar.setMax(mMaxVolume);
mLeftSeekBar.setMax(mMaxVolume);
mRightSeekBar.setMax(mMaxVolume);
updateCurrentVolume();
}
示例5: getVirtualizer
import android.media.audiofx.Virtualizer; //导入依赖的package包/类
public Virtualizer getVirtualizer() {
return mVirtualizer;
}
示例6: setVirtualizer
import android.media.audiofx.Virtualizer; //导入依赖的package包/类
public void setVirtualizer(Virtualizer virtualizer) {
mVirtualizer = virtualizer;
}
示例7: musicHandler
import android.media.audiofx.Virtualizer; //导入依赖的package包/类
@TargetApi(Build.VERSION_CODES.KITKAT)
public musicHandler(musicPlayer Gh) {
mEvent = new Event("PLayer");
this.Gh = Gh;
loadStartup();
mediaplayer = new MediaPlayer();
mediaplayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
@Override
public void onPrepared(MediaPlayer mp) {
if(needPlay){
isPrepared = true;
play(needId);
}else{
isPrepared = true;
if(needStop){
needStop = false;
}else{
mediaplayer.start();
}
mediaplayer.setOnCompletionListener(OC);
mEvent.trigger(playerEvents.SONG_CHANGED);
}
}
});
needStop = true;
playByNumber(0);
EQs = new EqlizerSettings(Gh.getBaseContext());
bass = new BassBoost(0, mediaplayer.getAudioSessionId());
bass.setEnabled(true);
equlizer = new Equalizer(0, mediaplayer.getAudioSessionId());
equlizer.setEnabled(true);
virtualizer = new Virtualizer(0, mediaplayer.getAudioSessionId());
virtualizer.setEnabled(true);
if(android.os.Build.VERSION.SDK_INT >= 19){
loudness = new LoudnessEnhancer( mediaplayer.getAudioSessionId());
loudness.setEnabled(true);
}else{
loudness = null;
}
setEQs(EQs.isOn);
setBass(EQs.BASS);
setTrable(EQs.TRABLE);
setVoice(EQs.VOICE);
setVirtualizer(EQs.VIRCHULIZER);
setLoudnessEnhancer(EQs.LOUDNESS);
mEvent.trigger(playerEvents.EQ_CHANGED);
mEvent.trigger(playerEvents.PLAYER_COMPLETE);
}
示例8: a
import android.media.audiofx.Virtualizer; //导入依赖的package包/类
public final View a(LayoutInflater paramLayoutInflater, ViewGroup paramViewGroup, Bundle paramBundle)
{
View localView1 = super.a(paramLayoutInflater, paramViewGroup, paramBundle, efj.wI);
this.d = new cqf(this, f());
View localView2 = localView1.findViewById(aaw.mk);
localView2.setOnClickListener(this);
this.d.setAnchorView(localView2);
this.d.setLayoutParams(new FrameLayout.LayoutParams(-1, -1));
this.Z = ((VideoView)localView1.findViewById(aaw.ml));
this.Z.setMediaController(this.d);
this.Z.setOnPreparedListener(this);
this.Z.setOnCompletionListener(this);
this.Z.setOnErrorListener(this);
v();
if ((paramBundle != null) && (this.a != null))
{
this.Z.start();
this.Z.suspend();
this.ah = true;
}
a(localView1, aau.lN);
int j;
if (this.ad.getBooleanExtra("virtualize", false))
{
if (Build.VERSION.SDK_INT < 18) {
break label259;
}
j = 1;
if (j != 0)
{
int k = this.Z.getAudioSessionId();
if (k != 0)
{
this.aj = new Virtualizer(0, k);
this.aj.setEnabled(true);
}
}
}
if (Build.VERSION.SDK_INT >= 14) {}
for (int i = 1;; i = 0)
{
if (i != 0) {
localView1.setOnSystemUiVisibilityChangeListener(new cqe(this));
}
return localView1;
label259:
j = 0;
break;
}
}