mt6735 如何设置这些音效:1音效模式默认打开,2.音效默认值如...
时间:10-02
整理:3721RD
点击:
【Audio Profile】如何设置这些音效:1音效模式默认打开,2.音效默认值如摇滚,3.低音增强、环绕声默认值如500
[DESCRIPTION]
如何设置这些音效:1音效模式默认打开,2.音效默认值如摇滚,3.低音增强、环绕声默认值如500
[SOLUTION]
修改packages\apps\MusicFX\src\com\android\musicfx\ControlPanelEffect.java的
initEffectsPreferences()中的代码:
1. 音效默认打开:
GLOBAL_ENABLED_DEFAULT = true
2.音效默认为摇滚:
(1). PRESET_EQUALIZER_CURRENT_PRESET_DEFAULT 修改为您所需要的值
(2)、在"Editor.putInt(Key.eq_current_preset.toString(), eQPreset);"下面添加如下代码:
boolean bEQPresetExist = prefs.contains(Key.eq_current_preset.toString());
Log.d(TAG, "initEffectsPreferences: bEQPresetExist = " + bEQPresetExist);
if(!bEQPresetExist){
short level = 0;
for (short band = 0; band < mEQNumBands; band++) {
// CI EXTREME
level = eQPresetCIExtremeBandLevel[band];
editor.putInt(Key.eq_band_level.toString() + band, level);
Log.d(TAG, "initEffectsPreferences: eq_band_level: band = " + band + ", level = " +
level);
}
}
(3)、在"mIntStatus.put(Key.eq_band_level.toString() + band,
prefs.getInt(Key.eq_band_level.toString() +
band,eQPresetUserBandLevelDefault[band]));"的下面添加如下代码:
if(!bEQPresetExist){
mIntStatus.put(Key.eq_band_level.toString() + band, prefs.getInt(
Key.eq_band_level.toString() + band, eQPresetCIExtremeBandLevel[band]));
}
(
4). 将 openSession()的
eQPreset = (short) prefs.getInt(Key.eq_current_preset.toString(), mEQNumPresets);
修改为
eQPreset = (short) prefs.getInt(Key.eq_current_preset.toString(),
PRESET_EQUALIZER_CURRENT_PRESET_DEFAULT);
3.低音增强、环绕声默认值如500
(1) 低音增强的默认值,是修改 BASS_BOOST_STRENGTH_DEFAULT 的值
(2) 环绕声:
final boolean isEnabled = prefs.getBoolean(Key.virt_enabled.toString(),
VIRTUALIZER_ENABLED_DEFAULT);
//删掉 int defaultstrength = isExistingAudioSession ? VIRTUALIZER_STRENGTH_DEFAULT :
//删掉 virtualizerEffect.getRoundedStrength();
intdefaultstrength = 500; // 添加
final int strength = prefs.getInt(Key.virt_strength.toString(), defaultstrength);
// init settings
Virtualizer.Settings settings = new Virtualizer.Settings("Virtualizer;strength="
+ strength);
[DESCRIPTION]
如何设置这些音效:1音效模式默认打开,2.音效默认值如摇滚,3.低音增强、环绕声默认值如500
[SOLUTION]
修改packages\apps\MusicFX\src\com\android\musicfx\ControlPanelEffect.java的
initEffectsPreferences()中的代码:
1. 音效默认打开:
GLOBAL_ENABLED_DEFAULT = true
2.音效默认为摇滚:
(1). PRESET_EQUALIZER_CURRENT_PRESET_DEFAULT 修改为您所需要的值
(2)、在"Editor.putInt(Key.eq_current_preset.toString(), eQPreset);"下面添加如下代码:
boolean bEQPresetExist = prefs.contains(Key.eq_current_preset.toString());
Log.d(TAG, "initEffectsPreferences: bEQPresetExist = " + bEQPresetExist);
if(!bEQPresetExist){
short level = 0;
for (short band = 0; band < mEQNumBands; band++) {
// CI EXTREME
level = eQPresetCIExtremeBandLevel[band];
editor.putInt(Key.eq_band_level.toString() + band, level);
Log.d(TAG, "initEffectsPreferences: eq_band_level: band = " + band + ", level = " +
level);
}
}
(3)、在"mIntStatus.put(Key.eq_band_level.toString() + band,
prefs.getInt(Key.eq_band_level.toString() +
band,eQPresetUserBandLevelDefault[band]));"的下面添加如下代码:
if(!bEQPresetExist){
mIntStatus.put(Key.eq_band_level.toString() + band, prefs.getInt(
Key.eq_band_level.toString() + band, eQPresetCIExtremeBandLevel[band]));
}
(
4). 将 openSession()的
eQPreset = (short) prefs.getInt(Key.eq_current_preset.toString(), mEQNumPresets);
修改为
eQPreset = (short) prefs.getInt(Key.eq_current_preset.toString(),
PRESET_EQUALIZER_CURRENT_PRESET_DEFAULT);
3.低音增强、环绕声默认值如500
(1) 低音增强的默认值,是修改 BASS_BOOST_STRENGTH_DEFAULT 的值
(2) 环绕声:
final boolean isEnabled = prefs.getBoolean(Key.virt_enabled.toString(),
VIRTUALIZER_ENABLED_DEFAULT);
//删掉 int defaultstrength = isExistingAudioSession ? VIRTUALIZER_STRENGTH_DEFAULT :
//删掉 virtualizerEffect.getRoundedStrength();
intdefaultstrength = 500; // 添加
final int strength = prefs.getInt(Key.virt_strength.toString(), defaultstrength);
// init settings
Virtualizer.Settings settings = new Virtualizer.Settings("Virtualizer;strength="
+ strength);