示例#1
0
 /// <summary>
 /// 计算指定Sai协议帧的时延。(单位:10毫秒)
 /// </summary>
 /// <param name="saiFrame"></param>
 /// <returns></returns>
 public long CalcTimeDelay(SaiFrame saiFrame)
 {
     if (SaiFrame.IsEcFrame(saiFrame.FrameType))
     {
         return(this.CalcEcTimeDelay(saiFrame as SaiEcFrame));
     }
     else if (SaiFrame.IsTtsFrame(saiFrame.FrameType))
     {
         return(this.CalcTtsTimeDelay(saiFrame as SaiTtsFrame));
     }
     else
     {
         throw new InvalidOperationException("指定的SaiFrame不可识别,无法计算时延。");
     }
 }
示例#2
0
 public void HandleFrame(SaiFrame saiFrame)
 {
     if (SaiFrame.IsEcFrame(saiFrame.FrameType))
     {
         this.HandleEcFrame(saiFrame as SaiEcFrame);
     }
     else if (SaiFrame.IsTtsFrame(saiFrame.FrameType))
     {
         this.HandleTtsFrame(saiFrame as SaiTtsFrame);
     }
     else
     {
         throw new NotImplementedException("指定的SaiFrame不可识别,SaiState无法处理。");
     }
 }