Пример #1
0
        void gateway_OnSessionCreate(object sender, EventArgs e)
        {
            if (queriedDevices == false)
            {
                queriedDevices = true;
                Logger.Log("Voice session started, asking for device info", Helpers.LogLevel.Debug);
                gateway.AuxGetCaptureDevices();
                gateway.AuxGetRenderDevices();
            }

            VoiceSession s = sender as VoiceSession;

            BeginInvoke(new MethodInvoker(delegate()
            {
                // There could theoretically be more than one session active
                // at a time, but the current implementation in SL seems to be limited to one.
                session = s;
                session.OnParticipantAdded   += new EventHandler(session_OnParticipantAdded);
                session.OnParticipantRemoved += new EventHandler(session_OnParticipantRemoved);
                session.OnParticipantUpdate  += new EventHandler(session_OnParticipantUpdate);
                participants.Clear();

                // Default Mic off and Spkr on
                gateway.MicMute   = true;
                gateway.SpkrMute  = false;
                gateway.SpkrLevel = 64;
                gateway.MicLevel  = 64;

                SetProgress(VoiceGateway.ConnectionState.SessionRunning);
            }));
        }