Skip to content

Instantly share code, notes, and snippets.

@j-onathan
Created August 26, 2014 17:40
Show Gist options
  • Save j-onathan/3f775ddf055c61514e89 to your computer and use it in GitHub Desktop.
Save j-onathan/3f775ddf055c61514e89 to your computer and use it in GitHub Desktop.
toneGen1 = new ToneGenerator(AudioManager.STREAM_MUSIC, 100);
toneGen2 = new ToneGenerator(AudioManager.STREAM_MUSIC, 50);
if (toneGen1.startTone(ToneGenerator.TONE_DTMF_1)) {
Thread.sleep(100);
if (toneGen2.startTone(ToneGenerator.TONE_DTMF_2)) {
Thread.sleep(500);
toneGen1.stopTone();
Thread.sleep(100);
toneGen2.stopTone();
} else {
toneGen1.stopTone();
result = false;
}
} else {
result = false;
}
toneGen1.release();
toneGen2.release();
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment