[Q] Volume buttons sound, annoying beep how to change it ?

fancy4

Member
Nov 30, 2011
9
2
0
I cant find the answer on whole net, starting to think that it isnt possible.

I have tried adding many variates of volume.mp3 and ogg's to /system/media/ui but it doesnt work, have searched for ogg mp3 wav's and raw files in system files but can't find a think that matches that awful beep sound.

Someone on a forum said that he saw rom with Piano sounds when he was changing volume.

i hope that someone figure it out already

thanks in advance
 

cardinalfib

New member
Jul 9, 2010
1
0
0
RE: Volume buttons sound, annoying beep how to change it ?

Here is my code to force volume keys to change media volume (instead of ringer volume) and then change the beep to a click.

Code:
//Volume controls changed to media volume
	@Override public boolean onKeyDown(int keyCode, KeyEvent keyEvent) {
		AudioManager audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE); // Get audioManager
		
		switch (keyCode) {
			case (KeyEvent.KEYCODE_VOLUME_UP):
			{
				audioManager.adjustStreamVolume(AudioManager.STREAM_MUSIC, AudioManager.ADJUST_RAISE, 0);
				return true;
			}
			case (KeyEvent.KEYCODE_VOLUME_DOWN):
			{
				audioManager.adjustStreamVolume(AudioManager.STREAM_MUSIC, AudioManager.ADJUST_LOWER, 0);
				return true;
			}
		}
		return super.onKeyDown(keyCode, keyEvent);
	}
	
	@Override public boolean onKeyUp(int keyCode, KeyEvent keyEvent) {
		if (keyCode == KeyEvent.KEYCODE_VOLUME_UP || keyCode == KeyEvent.KEYCODE_VOLUME_DOWN)
		{
			MediaPlayer clickPlayer = MediaPlayer.create(this, R.raw.click);
			try {
				clickPlayer.prepare();
			} catch (IllegalStateException e) {
				e.printStackTrace();
			} catch (IOException e) {
				e.printStackTrace();
			}
			clickPlayer.start();
		}
		return super.onKeyDown(keyCode, keyEvent);
	}
 

taylor_t

Member
Jul 15, 2012
47
9
0
Hi cardinalfib,

thansk for your code - it is exactly what I need.
I'm not an expert - could you tell me how I've to use this code?
What file have I to change?

Thanks a lot!
Tim
 
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone