private void playVoice(final int position, final ViewHolder holder, final boolean isSender) {
   // 记录播放录音的位置
   mPosition = position;
   Message msg = mMsgList.get(position);
   if (autoPlay) {
     mConv.updateMessageExtra(msg, "isReaded", true);
     holder.readStatus.setVisibility(View.GONE);
     if (mVoiceAnimation != null) {
       mVoiceAnimation.stop();
       mVoiceAnimation = null;
     }
     holder.voice.setImageResource(R.anim.jmui_voice_receive);
     mVoiceAnimation = (AnimationDrawable) holder.voice.getDrawable();
   }
   try {
     mp.reset();
     VoiceContent vc = (VoiceContent) msg.getContent();
     Log.i(TAG, "content.getLocalPath:" + vc.getLocalPath());
     mFIS = new FileInputStream(vc.getLocalPath());
     mFD = mFIS.getFD();
     mp.setDataSource(mFD);
     if (mIsEarPhoneOn) {
       mp.setAudioStreamType(AudioManager.STREAM_VOICE_CALL);
     } else {
       mp.setAudioStreamType(AudioManager.STREAM_MUSIC);
     }
     mp.prepare();
     mp.setOnPreparedListener(
         new OnPreparedListener() {
           @Override
           public void onPrepared(MediaPlayer mp) {
             mVoiceAnimation.start();
             mp.start();
           }
         });
     mp.setOnCompletionListener(
         new MediaPlayer.OnCompletionListener() {
           @Override
           public void onCompletion(MediaPlayer mp) {
             mVoiceAnimation.stop();
             mp.reset();
             mSetData = false;
             if (isSender) {
               holder.voice.setImageResource(R.drawable.jmui_send_3);
             } else {
               holder.voice.setImageResource(R.drawable.jmui_receive_3);
             }
             if (autoPlay) {
               int curCount = mIndexList.indexOf(position);
               Log.d(TAG, "curCount = " + curCount);
               if (curCount + 1 >= mIndexList.size()) {
                 nextPlayPosition = -1;
                 autoPlay = false;
               } else {
                 nextPlayPosition = mIndexList.get(curCount + 1);
                 notifyDataSetChanged();
               }
               mIndexList.remove(curCount);
             }
           }
         });
   } catch (FileNotFoundException e) {
     Toast.makeText(
             mContext, mContext.getString(R.string.file_not_found_toast), Toast.LENGTH_SHORT)
         .show();
   } catch (IOException e) {
     Toast.makeText(
             mActivity, mContext.getString(R.string.file_not_found_toast), Toast.LENGTH_SHORT)
         .show();
   } finally {
     try {
       if (mFIS != null) {
         mFIS.close();
       }
     } catch (IOException e) {
       e.printStackTrace();
     }
   }
 }