File: audio_buffer.h

package info (click to toggle)
chromaprint 1.6.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,336 kB
  • sloc: cpp: 58,922; python: 4,402; ansic: 3,461; sh: 440; makefile: 366
file content (19 lines) | stat: -rw-r--r-- 428 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <algorithm>
#include <vector>
#include "audio_consumer.h"

class AudioBuffer : public chromaprint::AudioConsumer
{
public:
	void Consume(const int16_t *input, int length) override
	{
		int last_size = m_data.size();
		m_data.resize(last_size + length);
		std::copy(input, input + length, m_data.begin() + last_size);
	}

	const std::vector<int16_t> &data() { return m_data; }

private:
	std::vector<int16_t> m_data;
};