21 const char* appDataDir = getenv(
"APPDATA");
23 return std::string(appDataDir) +
"/TimeAndPitchTuning";
28template <
typename Iterator>
30 std::ofstream& ofs, Iterator
begin, Iterator
end,
const char*
name)
32 ofs <<
name <<
" = [";
33 std::for_each(
begin,
end, [&](
float x) { ofs << x <<
","; });
40 , mLogSample { logSample }
54 mOfs = std::make_unique<std::ofstream>(
56 "/FormantShifterLog.py");
65 *
mOfs <<
name <<
" = " << value <<
"\n";
69 const float* samples,
size_t size,
const char*
name)
const
78 const std::complex<float>* cv,
size_t cvSize,
const char*
name,
79 const std::function<
float(
const std::complex<float>&)>& transform)
const
83 std::vector<float> v(cvSize);
84 std::transform(cv, cv + cvSize, v.begin(), transform);
89 std::complex<float>* spectrum,
size_t fftSize)
95 std::fill(spectrum, spectrum + fftSize / 2 + 1, 1.f);
Positions or offsets within audio files need a wide type.
constexpr auto sampleRate
const char * end(const char *str) noexcept
const char * begin(const char *str) noexcept