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


Java BassBoost类代码示例

本文整理汇总了Java中android.media.audiofx.BassBoost的典型用法代码示例。如果您正苦于以下问题:Java BassBoost类的具体用法?Java BassBoost怎么用?Java BassBoost使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


BassBoost类属于android.media.audiofx包,在下文中一共展示了BassBoost类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: release

import android.media.audiofx.BassBoost; //导入依赖的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.BassBoost; //导入依赖的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: initBass

import android.media.audiofx.BassBoost; //导入依赖的package包/类
public static void initBass(int audioID) {
    EndBass();
    try {
        bassBoost = new BassBoost(0, audioID);
        short savestr = (short) Extras.getInstance().saveEq().getInt(BASS_BOOST, 0);
        if (savestr > 0) {
            setBassBoostStrength(savestr);
        }else {
            setBassBoostStrength((short) 0);
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
开发者ID:RajneeshSingh007,项目名称:MusicX-music-player,代码行数:15,代码来源:BassBoosts.java

示例4: init

import android.media.audiofx.BassBoost; //导入依赖的package包/类
private void init() {
	equalizer = new Equalizer(0, audioSessionId);
	bass = new BassBoost(0, audioSessionId);
	if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
		loudnessAvailable = true;
		loudnessEnhancerController = new LoudnessEnhancerController(context, audioSessionId);
	}
}
 
开发者ID:nvllsvm,项目名称:Audinaut,代码行数:9,代码来源:EqualizerController.java

示例5: getBassBoost

import android.media.audiofx.BassBoost; //导入依赖的package包/类
public BassBoost getBassBoost() {
	if(released) {
		released = false;
		try {
			init();
		} catch (Throwable x) {
			bass = null;
			Log.w(TAG, "Failed to create bass booster.", x);
		}
	}
	return bass;
}
 
开发者ID:nvllsvm,项目名称:Audinaut,代码行数:13,代码来源:EqualizerController.java

示例6: apply

import android.media.audiofx.BassBoost; //导入依赖的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);
	}
}
 
开发者ID:nvllsvm,项目名称:Audinaut,代码行数:15,代码来源:EqualizerController.java

示例7: initEqualizer

import android.media.audiofx.BassBoost; //导入依赖的package包/类
/**
 * @param media player from apollo service.
 */
public static void initEqualizer(MediaPlayer player, Context context){
	releaseEqualizer();
	int id = player.getAudioSessionId();
	mEqualizer = new Equalizer(1,id);
	mBoost = new BassBoost(1, id);
	updateEqualizerSettings(context);
}
 
开发者ID:hubcarl,项目名称:mobile-manager-tool,代码行数:11,代码来源:MusicUtils.java

示例8: initMusicPlayer

import android.media.audiofx.BassBoost; //导入依赖的package包/类
public void initMusicPlayer(){
    Log.d("State", "MyService: initMusicPlayer()");
    player = new MediaPlayer();
    player.setWakeMode(getApplicationContext(), PowerManager.PARTIAL_WAKE_LOCK);
    player.setAudioStreamType(AudioManager.STREAM_MUSIC);
    MainActivity.SESSION=player.getAudioSessionId();
    Log.d("State","Session: "+player.getAudioSessionId());
    bass=new BassBoost(0,MainActivity.SESSION);
    bass.setEnabled(true);

    MainActivity.settings.moveToFirst();
    if(MainActivity.settings.getInt(4)==1) {
        bass.setStrength((short)1000);
    }else{
        bass.setStrength((short)0);
    }
    if(MainActivity.IS_FIRST_TIME_BY_SESSION_INIT) {
        afListenerMusic = new AFListener();
        int requestResult = audioManager.requestAudioFocus(afListenerMusic, AudioManager.STREAM_MUSIC, AudioManager.AUDIOFOCUS_GAIN);
        Log.d("State", "Music request focus, result: " + requestResult);
        MainActivity.IS_FIRST_TIME_BY_SESSION_INIT=false;
    }else{
        Player.setupEqualizer();
    }

    player.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
        @Override
        public void onCompletion(MediaPlayer mp) {
            musicCompleted();
        }
    });
}
 
开发者ID:romanvey,项目名称:LvivSoundGit,代码行数:33,代码来源:MyService.java

示例9: restoreBassBoost

import android.media.audiofx.BassBoost; //导入依赖的package包/类
private void restoreBassBoost() {
    mBassBoost = new BassBoost(Integer.MAX_VALUE, mSessionId);
    synchronized (SETTINGS_LOCK) {
        mBassBoost.setStrength((short) mBassBoostSettings.strength);
    }
    mBassBoost.setEnabled(true);
}
 
开发者ID:Doctoror,项目名称:PainlessMusicPlayer,代码行数:8,代码来源:AudioEffects.java

示例10: getBassBoost

import android.media.audiofx.BassBoost; //导入依赖的package包/类
public static BassBoost getBassBoost() {
    if (AudioTimeline.getMusicPlaybackService() == null
            || AudioTimeline.getMusicPlaybackService().getMediaPlayer() == null) {
        return null;
    }
    int audioSessionId = AudioTimeline.getMusicPlaybackService()
            .getMediaPlayer().getAudioSessionId();
    bassBoost = new BassBoost(0, audioSessionId);
    return bassBoost;
}
 
开发者ID:PavelKorolev,项目名称:liquid-bear-android,代码行数:11,代码来源:EqualizerManager.java

示例11: onCreate

import android.media.audiofx.BassBoost; //导入依赖的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

示例12: getBassBoost

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

示例13: setBassBoost

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

示例14: musicHandler

import android.media.audiofx.BassBoost; //导入依赖的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


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