Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Voice sounds like "donald-duck" #740

Open
mkiol opened this issue May 19, 2023 · 2 comments
Open

Voice sounds like "donald-duck" #740

mkiol opened this issue May 19, 2023 · 2 comments

Comments

@mkiol
Copy link

mkiol commented May 19, 2023

Firstly I would like to thank to all RHVoice team for your work. The quality of voice synthesis is truly amazing. Moreover i love the code. It is well written and elegant C++ which warms my hart even more ❤️ .

I'm using RHVoice as a library in the app I'm developing. I faced following problem on Linux:

  • RHVoice library generates funny "donald-duck" like voice instead proper one. Sample: 16877845491856538198.webm.
  • Surprisingly, the problem does not occur when OS language is set to 'en_US' but occurs when lang is for instance 'pl_PL'.

Luckily, I've managed to find the cause 😌. It appears that function which reads configuration for HTS engine uses atof and atof is locale-dependent. In my case (locale 'pl_PL') proper decimal separator is comma (not point) , therefore ALPHA parameter for the engine was always 0 because atof wasn't able to properly parse "ALPHA=0.466".

I'm compiling RHVoice libs from sources, so I fixed the problem using simple wrapper around atof. It works well in my case.

static double locale_independent_atof(const char *str) {
    const char *old_locale = setlocale(LC_NUMERIC, "C");
    double value = atof(str);
    setlocale(LC_NUMERIC, old_locale);
    return value;
}

Maybe someone else faced the similar problem and this will help save the day of debugging.

@zstanecic
Copy link
Contributor

zstanecic commented May 19, 2023 via email

@mkiol
Copy link
Author

mkiol commented May 19, 2023

Here the sampling rate can be the culprit, too.

Believe me, I've tried everything including changing the sampling rate for all possible values. For sure it was a atof. Literally, I spent one day with debugger comparing every line of code for OK and NOK case!

Positive side, I'm now GDB expert 😄.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants