Ejemplo n.º 1
0
 /// <summary>
 /// 获取语音消息安全密钥key信息
 /// 当申请成功后会通过OnApplyMessageKeyComplete进行回调
 /// </summary>
 public void ApplyMessageKey(int msTimeout = 10000)
 {
     if (m_voiceengine != null)
     {
         m_voiceengine.ApplyMessageKey(msTimeout);
     }
 }
Ejemplo n.º 2
0
 public void Click_btnReqAuthKey()
 {
     if (Application.platform == RuntimePlatform.Android || Application.platform == RuntimePlatform.IPhonePlayer)
     {
         PlayLog("ApplyMessageKey btn click");
         m_voiceengine.ApplyMessageKey(15000);
     }
 }
Ejemplo n.º 3
0
    //初始化Team
    public int InitTeam(string gameId, string gameKey, string openId, int msTimeout, int type = 0)
    {
        mVoiceengine = GCloudVoice.GetEngine();
        mVoiceengine.SetAppInfo(gameId, gameKey, openId);
        int initResult = mVoiceengine.Init();

        mVoiceengine.ApplyMessageKey(msTimeout);
        mVoiceengine.SetMode((GCloudVoiceMode)type);

        return(initResult);
    }
Ejemplo n.º 4
0
 public void ApplyMessageKey()
 {
     if (Application.platform == RuntimePlatform.WindowsEditor || Application.platform == RuntimePlatform.OSXEditor)
     {
         return;
     }
     if (isApplyMessageKey)
     {
         m_voiceengine.ApplyMessageKey(15000);
         isApplyMessageKey = false;
     }
 }
Ejemplo n.º 5
0
    //初始化语音
    public void Init(string gameId, string gameKey, string openId, int msTimeout)
    {
        if (mVoiceengine == null)
        {
            mVoiceengine = GCloudVoice.GetEngine();
        }
        mVoiceengine.SetAppInfo(gameId, gameKey, openId);
        mVoiceengine.Init();
        mVoiceengine.ApplyMessageKey(msTimeout);
        mVoiceengine.SetMode(GCloudVoiceMode.Messages);
        int ret1 = mVoiceengine.SetMaxMessageLength(60000);

        Debug.Log("SetMaxMessageLength ret==" + ret1);
    }
Ejemplo n.º 6
0
    public bool Start()
    {
        if (!IsStarted)
        {
            IGCloudVoice engine = _Manager.Gcloud_VoiceMan.VoiceEngine;

            engine.OnApplyMessageKeyComplete    += OnApplyMessageKeyComplete;
            engine.OnUploadReccordFileComplete  += OnUploadReccordFileComplete;
            engine.OnDownloadRecordFileComplete += OnDownloadRecordFileComplete;
            engine.OnPlayRecordFilComplete      += PlayRecordFileComplete;

            if (!_bIsGetAuthKey)
            {
                engine.ApplyMessageKey(15000);
            }

            IsStarted = true;
        }

        return(IsStarted);
    }
Ejemplo n.º 7
0
        void ApplyKey()
        {
            int err = m_voiceengine.ApplyMessageKey(5500);

            switch ((GCloudVoiceErr)err)
            {
            case GCloudVoiceErr.GCLOUD_VOICE_PARAM_INVALID:
                Debug.Log("传入的参数不对,比如超时范围5000ms-60000ms。");
                break;

            case GCloudVoiceErr.GCLOUD_VOICE_NEED_INIT:
                Debug.LogError("需要执行初始化");
                break;

            case GCloudVoiceErr.GCLOUD_VOICE_AUTHKEY_ERR:
                Debug.LogError("请求Key的内部错误,此时需要联系GCloud团队,并提供日志进行定位");
                MahjongCommonMethod.Instance.ShowRemindFrame("错误:" + err);
                break;

            default:
                break;
            }
        }
Ejemplo n.º 8
0
 public void Click_btnReqAuthKey()
 {
     Debug.Log("ApplyMessageKey btn click");
     m_voiceengine.ApplyMessageKey(15000);
 }
Ejemplo n.º 9
0
 public void ReqAuthKey()
 {
     //Debug.LogError("ReqAuthKey");
     mVoiceEngine.ApplyMessageKey(6000);
 }