blob: 7b114f59eb61eafe05cbfa98dff30d0669908d0d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
#pragma once
#include <sys/_stdint.h>
#include <vector>
#include "span.hpp"
#include "speex/speex_resampler.h"
#include "sample.hpp"
namespace audio {
class Resampler {
public:
Resampler(uint32_t source_sample_rate,
uint32_t target_sample_rate,
uint8_t num_channels);
~Resampler();
auto Process(cpp::span<sample::Sample> input,
cpp::span<sample::Sample> output,
bool end_of_data) -> std::pair<size_t, size_t>;
private:
int err_;
SpeexResamplerState* resampler_;
uint8_t num_channels_;
};
} // namespace audio
|