I'm new to android development
I'm working in an android app that simply changes volume and play beep "to preview current sound level"
I use startTone
in ToneGenerator
class to generate this beep , like this :
ToneGenerator tg = new ToneGenerator(AudioManager.STREAM_RING, 100);
tg.startTone(ToneGenerator.TONE_PROP_BEEP);
but sometimes this code doesn't work and generate following exceptions
11-20 00:32:44.262: E/AudioTrack(4701): AudioFlinger could not create track, status: -12
11-20 00:32:44.262: E/ToneGenerator(4701): AudioTrack->initCheck failed
Thanks.