... use the default beep for Android (for example, when adjusting the ringer volume) ...
On my Cyanogen 7 Nexus One and my old stock of T-Mobile Pulse Mini (the last from memory), as far as I can hear, this is exactly the default beep when you change the volume:
final ToneGenerator tg = new ToneGenerator(AudioManager.STREAM_NOTIFICATION, 100); tg.startTone(ToneGenerator.TONE_PROP_BEEP);
It seems you are asking for an alternative to ToneGenerator , but I think this gives you exactly what you want in two lines.
Here are a few other possible ToneGenerator sounds that I tried that did not match (the first two can be useful as an alternative to loud sound):
// Double beeps: tg.startTone(ToneGenerator.TONE_PROP_ACK); // Double beeps: tg.startTone(ToneGenerator.TONE_PROP_BEEP2); // Sounds all wrong: tg.startTone(ToneGenerator.TONE_CDMA_KEYPAD_VOLUME_KEY_LITE);
ahcox May 2 '12 at 14:42 2012-05-02 14:42
source share