当前位置: 首页>>代码示例>>Java>>正文


Java Virtualizer类代码示例

本文整理汇总了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();
    }
}
 
开发者ID:Tombarr,项目名称:Noyze,代码行数:15,代码来源:EqualizerVolumePanel.java

示例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);
    }
 
开发者ID:reyanshmishra,项目名称:Rey-MusicPlayer,代码行数:15,代码来源:EqualizerHelper.java

示例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();
    }
}
 
开发者ID:RajneeshSingh007,项目名称:MusicX-music-player,代码行数:15,代码来源:Virtualizers.java

示例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();

}
 
开发者ID:mengdd,项目名称:HelloAudioEffect,代码行数:30,代码来源:HelloAudioEffectsActivity.java

示例5: getVirtualizer

import android.media.audiofx.Virtualizer; //导入依赖的package包/类
public Virtualizer getVirtualizer() {
    return mVirtualizer;
}
 
开发者ID:reyanshmishra,项目名称:Rey-MusicPlayer,代码行数:4,代码来源:EqualizerHelper.java

示例6: setVirtualizer

import android.media.audiofx.Virtualizer; //导入依赖的package包/类
public void setVirtualizer(Virtualizer virtualizer) {
    mVirtualizer = virtualizer;
}
 
开发者ID:reyanshmishra,项目名称:Rey-MusicPlayer,代码行数:4,代码来源:EqualizerHelper.java

示例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);

}
 
开发者ID:KishanV,项目名称:Android-Music-Player,代码行数:61,代码来源:musicHandler.java

示例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;
  }
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:51,代码来源:cqc.java


注:本文中的android.media.audiofx.Virtualizer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。