13 #ifndef OPENSHOT_WAVEFORMER_H 14 #define OPENSHOT_WAVEFORMER_H 36 max_samples.resize(total_samples);
37 rms_samples.resize(total_samples);
41 void zero(
int total_samples) {
42 std::fill(max_samples.begin(), max_samples.end(), 0);
43 std::fill(rms_samples.begin(), rms_samples.end(), 0);
47 void scale(
int total_samples,
float factor) {
48 for (
auto s = 0; s < total_samples; s++) {
49 max_samples[s] *= factor;
50 rms_samples[s] *= factor;
57 max_samples.shrink_to_fit();
59 rms_samples.shrink_to_fit();
63 std::vector<std::vector<float>>
vectors() {
64 std::vector<std::vector<float>> output;
65 output.push_back(max_samples);
66 output.push_back(rms_samples);
91 AudioWaveformData ExtractSamples(
int channel,
int num_per_second,
bool normalize);
Header file for ReaderBase class.
This abstract class is the base class, used by all readers in libopenshot.
Header file for Frame class.
This namespace is the default namespace for all code in the openshot library.