// Use this for initialization void Awake() { if (instance == null) { instance = this; } m_voiceengine = GCloudVoice.GetEngine(); }
/// <summary> /// 当点击播放记录的时候下载到本地 /// </summary> public void DownVoice() { //bool bb = false; string DownLoadlocalfilePath = string.Format("{0}{1}.amr", VoiceManegerMethord.Instance.isExistGvoiceFile(MahjongLobby_AH.SDKManager.DataPath), DateTime.Now.ToFileTime()); ShortTalkData std = GameData.Instance.ShortTalkData; if (!std._DownLoadFilePath.ContainsKey(_url)) { std._DownLoadFilePath.Add(_url, DownLoadlocalfilePath); } string fileid = DateTime.Now.ToFileTime().ToString(); if (VoiceManegerMethord.VoiceFlag == 1) { int downLoadErr = VoiceManegerMethord.Instance.m_voiceengine.DownloadRecordedFile(VoiceManegerMethord.ByteArrayToHexString(_id), DownLoadlocalfilePath, 6000); } else { YunVaImSDK.instance.DownLoadFileRequest(_url, DownLoadlocalfilePath, fileid, (data4) => { if (data4.result == 0) { Debug.Log("下载成功:" + data4.filename); PlayRecordVoice(); // bb = true; } else { Debug.Log("下载失败:" + data4.msg); //bb = false; } }); } //return bb; }