@Override
 protected void onDestroy() {
   try {
     if (amrEncoder != null) {
       amrEncoder.stop();
     }
     if (audioPlayer != null) {
       audioPlayer.stop();
     }
   } catch (Exception e) {
   }
   super.onDestroy();
 }
 private void stopPlayAudio() {
   if (audioPlayer != null) {
     audioPlayer.stop();
   }
 }