Ejemplo n.º 1
0
        public int Write(IReadOnlyTimeLocatedBufferFFT source, int offsetFrames, int frames)
        {
            var written = _buffer.Write(source.Data, offsetFrames * FrameSize, frames * FrameSize);

            if (written % FrameSize != 0)
            {
                throw new InvalidOperationException();
            }
            Time = Time.Increment(written * 2, Samplerate);
            return(written / FrameSize);
        }
Ejemplo n.º 2
0
        public int Write(IReadOnlyTimeLocatedBufferFFT buffer, int offset, int frameCount)
        {
            if (buffer.Samplerate != Samplerate)
            {
                throw new InvalidOperationException();
            }
            if (buffer.FFTSize != FFTSize)
            {
                throw new InvalidOperationException();
            }

            var written = _queue.Write(buffer, offset, frameCount);

            _stamp = _stamp.Increment(written * FFTSize, Samplerate);
            return(written);
        }
Ejemplo n.º 3
0
 public int Write(IReadOnlyTimeLocatedBufferFFT buffer)
 {
     return(Write(buffer, 0, buffer.Available));
 }