Ejemplo n.º 1
0
        public virtual void Fill(IAudioStream source, int samples, bool loop)
        {
            int byteCount = samples * _blockAlign;

            //Lock buffer and fill
            BufferData data = Lock(_writeOffset, byteCount);

            try { data.Fill(source, loop); }
            finally { Unlock(data); }

            //Advance offsets
            _writeOffset = (_writeOffset + byteCount) % _dataLength;
            _writeSample = source.SamplePosition;
        }