0
我在我的应用程序中提供了一个静音选项,同样在设置屏幕中,但虽然这会使声音效果消失,但在平板电脑上按下的任何可点击项目仍然会获得默认设置点击声音。我怎样才能阻止系统点击的发生?这是我目前的playSound方法,它不会播放我已设置了mMute的音效。同时支持平板电脑和手机的问题 - 声音
try {
streamVolume = mAudioManager
.getStreamVolume(AudioManager.STREAM_MUSIC);
streamVolume = streamVolume
/mAudioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
} catch (NullPointerException e) {
Log.e(DEBUG_TAG, "Null pointer returned from audio manager");
}
Integer soundToPlay = mSoundPoolMap.get(sound);
if (streamVolume != 0.0f && soundToPlay != null && !mMute) {
mSoundPool.play(mSoundPoolMap.get(sound),
streamVolume, streamVolume,
1, 0, 1.0f);
} else {
Log.e(DEBUG_TAG, sound.toString() + " not found in sound pool map");
}
}
是否有任何其他提示可用于平板电脑的声音处理?我认为它略有不同。
嗨核磁共振,我目前有很多我的观点定义的风格和主题,以便可以工作,并很快改变。我会尝试在MyButton样式中使用android:soundEffectsEnabled> false并查看是否有效。 –
作品。很高兴我用过主题/风格 - 我几乎不得不改变任何东西。 –