Example #1
0
    void OnDownloadRecordFileComplete(IGCloudVoice.GCloudVoiceCompleteCode code, string filepath, string fileid)
    {
        if (onAction != null)
        {
            onAction.Call("onAction", JsonUtility.ToJson(new GVoiceManagerAction()
            {
                eventName = "OnDownloadRecordFileComplete",
                code      = code.ToString(),
                data      = filepath + "|" + fileid
            }));
        }

        Debug.Log("OnDownloadRecordFileComplete c# callback");
        if (code == IGCloudVoice.GCloudVoiceCompleteCode.GV_ON_DOWNLOAD_RECORD_DONE)
        {
            Debug.Log("OnDownloadRecordFileComplete succ, filepath:" + filepath + " fileid:" + fileid);
            if (onDownloadRecordFileComplete != null)
            {
                onDownloadRecordFileComplete(filepath, fileid);
            }
            //暂停背景音乐
        }
        else
        {
            Debug.Log("OnDownloadRecordFileComplete error");
        }
    }
Example #2
0
    void OnApplyMessageKeyComplete(IGCloudVoice.GCloudVoiceCompleteCode code)
    {
        if (onAction != null)
        {
            onAction.Call("onAction", JsonUtility.ToJson(new GVoiceManagerAction()
            {
                eventName = "OnApplyMessageKeyComplete",
                code      = code.ToString()
            }));
        }

        if (code == IGCloudVoice.GCloudVoiceCompleteCode.GV_ON_MESSAGE_KEY_APPLIED_SUCC)
        {
            Debug.Log("OnApplyMessageKeyComplete succ11");
            if (onInitComplete != null)
            {
                onInitComplete(string.Empty);
            }
        }
        else
        {
            Debug.Log("OnApplyMessageKeyComplete error");
            if (onInitComplete != null)
            {
                onInitComplete(code + "");
            }
        }
    }
Example #3
0
    void OnUploadReccordFileComplete(IGCloudVoice.GCloudVoiceCompleteCode code, string filepath, string fileid)
    {
        if (onAction != null)
        {
            onAction.Call("onAction", JsonUtility.ToJson(new GVoiceManagerAction()
            {
                eventName = "OnUploadReccordFileComplete",
                code      = code.ToString(),
                data      = fileid
            }));
        }

        Debug.Log("OnUploadReccordFileComplete c# callback" + code + " filepath " + filepath + " fileid " + fileid);
        if (code == IGCloudVoice.GCloudVoiceCompleteCode.GV_ON_UPLOAD_RECORD_DONE)
        {
            Debug.Log("OnUploadReccordFileComplete succ11");
            //int ret = m_voiceengine.DownloadRecordedFile(m_fileid, m_downloadpath, 60000);
            //广播给其他玩家
            if (onUploadReccordFileComplete != null)
            {
                onUploadReccordFileComplete(fileid);
            }
        }
        else
        {
            //如果上传失败了需要
            Debug.Log("OnUploadReccordFileComplete error");
        }
    }
Example #4
0
    void OnPlayRecordFilComplete(IGCloudVoice.GCloudVoiceCompleteCode code, string filepath)
    {
        if (onAction != null)
        {
            onAction.Call("onAction", JsonUtility.ToJson(new GVoiceManagerAction()
            {
                eventName = "OnPlayRecordFilComplete",
                code      = code.ToString(),
                data      = filepath
            }));
        }

        Debug.Log("OnPlayRecordFilComplete c# callback");
        if (code == IGCloudVoice.GCloudVoiceCompleteCode.GV_ON_PLAYFILE_DONE)
        {
            if (onPlayRecordFilComplete != null)
            {
                onPlayRecordFilComplete(filepath);
            }
            Debug.Log("OnPlayRecordFilComplete succ, filepath:" + filepath);
        }
        else
        {
            Debug.Log("OnPlayRecordFilComplete error");
        }
    }