List of utility methods to do Audio Sound Turn
void | mute(Context context, boolean on) mute AudioManager amanager = (AudioManager) context .getSystemService(Context.AUDIO_SERVICE); amanager.setStreamMute(AudioManager.STREAM_DTMF, on); amanager.setStreamMute(AudioManager.STREAM_NOTIFICATION, on); amanager.setStreamMute(AudioManager.STREAM_RING, on); amanager.setStreamMute(AudioManager.STREAM_SYSTEM, on); amanager.setStreamMute(AudioManager.STREAM_ALARM, on); amanager.setStreamMute(AudioManager.STREAM_MUSIC, on); ... |
void | turnDown(Context context) turn Down Debug.e("Globle", "turnDown"); AudioManager audioMgr = (AudioManager) context .getSystemService(Context.AUDIO_SERVICE); audioMgr.setRingerMode(AudioManager.RINGER_MODE_SILENT); |
void | turnPre(Context context) turn Pre Debug.e("Globle", "turnPre"); AudioManager audioMgr = (AudioManager) context .getSystemService(Context.AUDIO_SERVICE); audioMgr.setRingerMode(AudioManager.RINGER_MODE_NORMAL); |
void | turnUpMost(Context context) turn Up Most Debug.e("Globle", "turnUpMost"); AudioManager audioMgr = (AudioManager) context .getSystemService(Context.AUDIO_SERVICE); audioMgr.setRingerMode(AudioManager.RINGER_MODE_NORMAL); audioMgr.setStreamVolume(AudioManager.STREAM_RING, audioMgr.getStreamMaxVolume(AudioManager.STREAM_RING), 0); audioMgr.setStreamVolume(AudioManager.STREAM_NOTIFICATION, audioMgr .getStreamMaxVolume(AudioManager.STREAM_NOTIFICATION), 0); ... |
void | turnUpSecond(Context context) turn Up Second Debug.e("Globle", "turnUpSecond"); AudioManager audioMgr = (AudioManager) context .getSystemService(Context.AUDIO_SERVICE); audioMgr.setRingerMode(AudioManager.RINGER_MODE_NORMAL); audioMgr.setStreamVolume(AudioManager.STREAM_RING, audioMgr.getStreamMaxVolume(AudioManager.STREAM_RING) - 2, 0); audioMgr.setStreamVolume(AudioManager.STREAM_NOTIFICATION, audioMgr ... |