예제 #1
0
        public void AddAudioData(long startByte, byte[] data)
        {
            AudioSegment segment = new AudioSegment()
            {
                StartIndex = startByte,
                Data       = data
            };

            if (CurrentSegment == null)
            {
                if (startByte + data.Length > Position)
                {
                    CurrentSegment = segment;
                }
            }
            else
            {
                CurrentSegment.Insert(segment);
            }
        }
예제 #2
0
 public void Insert(AudioSegment newSegment)
 {
     if (NextSegment == null)
     {
         if (newSegment.StartIndex + newSegment.Data.Length > StartIndex + Data.Length)
         {
             NextSegment = newSegment;
         }
     }
     else
     {
         if (newSegment.StartIndex < NextSegment.StartIndex)
         {
             newSegment.NextSegment = NextSegment;
             NextSegment            = newSegment;
         }
         else
         {
             NextSegment.Insert(newSegment);
         }
     }
 }