コード例 #1
0
        private void OnPacketTime(object state)
        {
            if (this.method == null || this.currentEvent == null)
            {
                // TODO: send mute data here
                return;
            }

            if (this.currentEvent.IsValid())
            {
                var data = this.currentEvent.GetData(this.watch.ElapsedMilliseconds);
                this.method.Invoke(data);
            }
            else
            {
                this.currentEvent = null;
            }
        }
コード例 #2
0
ファイル: NAudioRecordDevice.cs プロジェクト: inrg/sipstack
        private void DataAvailable(object sender, WaveInEventArgs e)
        {
            if (this.method == null)
            {
                return;
            }

            if (this.currentEvent == null)
            {
                this.method.Invoke(new RtpPayload(e.Buffer, (short)Interlocked.Increment(ref this.sequenceNumber), 0xFA, this.watcher.ElapsedMilliseconds, false));
                return;
            }

            if (this.currentEvent.IsValid())
            {
                var data = this.currentEvent.GetData(this.watcher.ElapsedMilliseconds);
                this.method.Invoke(data);
            }
            else
            {
                this.currentEvent = null;
            }
        }
コード例 #3
0
 public void PlayDtmf(Digit digit, int duration)
 {
     this.currentEvent = new RtpEvent(digit, duration, (short)Interlocked.Increment(ref this.sequenceNumber), 0xFA);
     //this.currentEventDuration = duration;
     throw new NotImplementedException();
 }
コード例 #4
0
ファイル: NAudioRecordDevice.cs プロジェクト: inrg/sipstack
 public void PlayDtmf(Digit digit, int duration)
 {
     this.currentEvent = new RtpEvent(digit, duration, (short)Interlocked.Increment(ref this.sequenceNumber), 0xFA);
 }