예제 #1
0
 void Start()
 {
     //初始化
     mRtcEngine = IRtcEngine.GetEngine(appId);
     mRtcEngine.SetChannelProfile(CHANNEL_PROFILE.GAME_FREE_MODE);
     mRtcEngine.EnableAudioVolumeIndication(200, 3);
 }
    private void JoinChannel(string channelName, uint uid)
    {
        Debug.Log(string.Format("Tap joinChannel with channel name {0}", channelName));

        if (string.IsNullOrEmpty(channelName))
        {
            return;
        }
        if (mRtcEngine != null)
        {
            mRtcEngine.JoinChannel(channelName);
            mRtcEngine.EnableAudioVolumeIndication(500, 3, true);
        }
        else
        {
            Invoke(channelName, 1);
        }
    }
    void LoadAgoraKit()
    {
        mRtcEngine = IRtcEngine.GetEngine(ApplicationModal.AppId);

        mRtcEngine.SetLogFilter(LOG_FILTER.DEBUG);
        string rtcLogFile = LocalLogFilePath();

        mRtcEngine.SetLogFile(rtcLogFile);
        Debug.Log(string.Format("SetLogFile {0}", rtcLogFile));

        if (ApplicationModal.AudioGameProfile == 0)
        {
            mRtcEngine.SetChannelProfile(CHANNEL_PROFILE.GAME_FREE_MODE);
        }
        else
        {
            mRtcEngine.SetChannelProfile(CHANNEL_PROFILE.GAME_COMMAND_MODE);
        }

        mRtcEngine.EnableAudioVolumeIndication(200, 3);
        LoadEngineCallbacks();
    }
    void LoadAgoraKit()
    {
        mRtcEngine = IRtcEngine.GetEngine(ApplicationModal.AppId);
        mRtcEngine.SetLogFilter(LOG_FILTER.DEBUG);
        string rtcLogFile = LocalLogFilePath();

        mRtcEngine.SetLogFile(rtcLogFile);
        Debug.Log(string.Format("SetLogFile {0}", rtcLogFile));
        versionText.GetComponent <Text> ().text = "Version : " + IRtcEngine.GetSdkVersion();
        Debug.Log(" SDK  version  =  " + IRtcEngine.GetSdkVersion());
        if (ApplicationModal.AudioGameProfile == 0)
        {
            mRtcEngine.SetChannelProfile(CHANNEL_PROFILE.CHANNEL_PROFILE_COMMUNICATION);
        }
        else
        {
            mRtcEngine.SetChannelProfile(CHANNEL_PROFILE.CHANNEL_PROFILE_LIVE_BROADCASTING);
        }
        mRtcEngine.EnableSoundPositionIndication(true);
        mRtcEngine.EnableAudioVolumeIndication(200, 3, true);
        LoadEngineCallbacks();
    }