示例#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
        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
 public void PlayDtmf(Digit digit, int duration)
 {
     this.currentEvent = new RtpEvent(digit, duration, (short)Interlocked.Increment(ref this.sequenceNumber), 0xFA);
 }