Notice
Recent Posts
Recent Comments
Link
관리 메뉴

설.현.아빠

안드로이드 볼륨 조절 - AudioManager 본문

안드로이드/Device & Sensor

안드로이드 볼륨 조절 - AudioManager

설.현.아빠 2011. 2. 11. 09:54



AudioManager audio = (AudioManager) getSystemService(Context.AUDIO_SERVICE);

 

// ring volume down

audio.setStreamVolume(AudioManager.STREAM_RING, (int)(audio.getStreamMaxVolume(AudioManager.STREAM_RING)*0.25),

AudioManager.FLAG_PLAY_SOUND);

 

// media volume up

audio.setStreamVolume(AudioManager.STREAM_MUSIC, (int)(audio.getStreamMaxVolume(AudioManager.STREAM_MUSIC)*0.75),

AudioManager.FLAG_PLAY_SOUND);

Comments