-
Notifications
You must be signed in to change notification settings - Fork 10
/
webrtc_delay_estimation.h
74 lines (59 loc) · 1.37 KB
/
webrtc_delay_estimation.h
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#ifndef DELAY_ESTIMATOR_H_
#define DELAY_ESTIMATOR_H_
#include <cstddef>
#include <exception>
#include <string>
#include <vector>
namespace webrtc_delay_estimation {
/**
* Structure that holds information about WAV files.
*
* Note that the sample must be supplied in float, and int16 sampling is not
* supported.
*/
struct WavFileInfo {
/**
* Sampling rate of the WAV file.
*/
size_t sample_rate;
/**
* Number of channels present in the WAV file.
*/
size_t num_channels;
/**
* Vector of all samples in the WAV file.
*/
std::vector<float> samples;
};
/**
* Structure that holds setting information.
*/
struct Setting {
/**
* Down sampling factor to use when estimating.
*/
size_t down_sampling_factor;
/**
* Number of filters to apply when estimating.
*/
size_t num_filters;
};
/**
* Exception that represents there is no viable estimation result available.
*/
class NoEstimateAvailableError final : std::exception {
public:
const char* what() const noexcept override;
};
/**
* Exception that represents the input files are not compatible.
*/
class IncompatibleInputsError final : std::exception {
public:
const char* what() const noexcept override;
};
size_t EstimateDelay(WavFileInfo& render,
WavFileInfo& capture,
Setting setting);
} // namespace webrtc_delay_estimation
#endif