private void onSendVoice() { if (isRecord) { filePath = mRtcEngine.AgoraIMGetRecordAudioFilePath(); int length = mRtcEngine.AgoraIMGetRecordAudioLength(); logD("onSendVoice--->wrapper ---- path ---> " + filePath + "----length ----->" + length); GameObject gameObject1 = GameObject.Find("SenderId"); InputField input2 = gameObject1.GetComponent <InputField> (); mRtcEngine.AgoraIMSendVoiceMessage(input2.text, agora_gaming_rtc.ConversationType.PRIVATE, filePath, length, userInfo); isRecord = false; } }