AcoustID.Chromaprint.CombinedBuffer.Flush C# (CSharp) Méthode

Flush() public méthode

Read all remaining values from the buffer.
public Flush ( short buffer ) : void
buffer short Buffer to write into.
Résultat void
        public void Flush(short[] buffer)
        {
            // Read the whole buffer (offset will be taken care of).
            if (this.Size > 0)
            {
                this.Read(buffer, 0, this.Size);
            }
        }
    }

Usage Example

Exemple #1
0
        public void Consume(short[] input, int length)
        {
            // Special case, just pre-filling the buffer
            if (m_buffer_offset + length < m_frame_size)
            {
                Array.Copy(input, 0, m_buffer, m_buffer_offset, length);
                m_buffer_offset += length;
                return;
            }

            // Apply FFT on the available data
            CombinedBuffer combined_buffer = new CombinedBuffer(m_buffer, m_buffer_offset, input, length);

            while (combined_buffer.Size >= m_frame_size)
            {
                combined_buffer.Read(m_input, 0, m_frame_size);
                m_lib.ComputeFrame(m_input, m_frame.Data);

                m_consumer.Consume(m_frame);
                combined_buffer.Shift(m_increment);
            }

            // Copy the remaining input data to the internal buffer
            combined_buffer.Flush(m_buffer);

            m_buffer_offset = combined_buffer.Size;
        }
All Usage Examples Of AcoustID.Chromaprint.CombinedBuffer::Flush