Update inferPreprocess.hpp

This commit is contained in:
Ναρουσέ·μ·γιουμεμί·Χινακάννα 2023-04-07 23:50:26 +08:00 committed by GitHub
parent 1c868ec334
commit 6619e314a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 0 deletions

View File

@ -158,3 +158,18 @@ inline SliceResult SliceWav(Wav& input, double threshold, unsigned long minLen,
return { std::move(output),std::move(tag) };
}
std::vector<long long> F0PreProcess::GetF0AndOtherInput(const double* audio, int64_t audioLen, int64_t hubLen, int64_t tran)
{
compute_f0(audio, audioLen);
for (int64_t i = 0; i < f0Len; ++i)
{
rf0[i] = rf0[i] * pow(2.0, static_cast<double>(tran) / 12.0);
if (rf0[i] < 0.001)
rf0[i] = NAN;
}
InterPf0(hubLen);
const auto O0f = f0Log();
std::vector<long long> Of0(O0f, O0f + f0Len);
delete[] O0f;
return Of0;
}