Audacity 3.2.0
FormantShifterLogger.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*!********************************************************************
3
4 Audacity: A Digital Audio Editor
5
6 FormantShifterLogger.h
7
8 Implements FormantShifterLoggerInterface, and also provides tuning utilities
9 to override algorithm parameters.
10
11 Matthieu Hodgkinson
12
13**********************************************************************/
14#pragma once
15
17#include <fstream>
18#include <memory>
19
21{
22public:
23 FormantShifterLogger(int sampleRate, int logTimeInSamples);
24 ~FormantShifterLogger() override;
25
26 void NewSamplesComing(int sampleCount) override;
27
28 // Methods intended to be called from FormantShifter
29public:
30 void Log(int value, const char* name) const override;
31 void Log(const float* samples, size_t size, const char* name) const override;
32 void Log(
33 const std::complex<float>* samples, size_t size, const char* name,
34 const std::function<float(const std::complex<float>&)>& transform)
35 const override;
41 void ProcessFinished(std::complex<float>* spectrum, size_t fftSize) override;
42
43private:
44 const int mSampleRate;
45 const int mLogSample;
46 bool mWasLogged = false;
47 std::unique_ptr<std::ofstream> mOfs;
48 int mSampleCount = 0;
49};
const TranslatableString name
Definition: Distortion.cpp:76
std::unique_ptr< std::ofstream > mOfs
void NewSamplesComing(int sampleCount) override
FormantShifterLogger(int sampleRate, int logTimeInSamples)
void Log(int value, const char *name) const override
void ProcessFinished(std::complex< float > *spectrum, size_t fftSize) override
If not already, disables the logging and marks the spectrum with an audible event to make clear where...
Positions or offsets within audio files need a wide type.
Definition: SampleCount.h:19