Fix the replacement character in the input string (#2024)
The correction uses substitute character (0x001A) as a workaround. This
control character is the "older brother" of the replacement character
OxFFFD.
The workaround is necessary because the replacement character (0xFFFD)
is used to flag to indicate an error or EOF. The substitute character
(0x001A) was included as an alternative flag to indicate that the input
character itself is a replacement character (0xFFFD).
On non-FHS systems like NixOS, there is no `/usr`. Additionally,
Nix has immutable packages so mbrola cannot be installed to espeak-ng’s
`datadir`. Instead, packages are expected to find data under one of the paths
listed in `XDG_DATA_DIRS` environment variable, as defined in the XDG Base
Directory Specification:
https://specifications.freedesktop.org/basedir-spec/basedir-spec-0.6.html#variables
84e967c0a2 ("Update translate.c") (sic) dropped the initialization of
number_buf, breaking the CI on ubuntu amd64 clang+msan, ubuntu amd64/i386
gcc/clang+valgrind,
While this probably deserves cleaning up, we'd rather not break the CI,
to be able to properly track regressions.
Without this function declaration, the build fails on modern C compilers (ISO C99). This affects e.g. builds on Apple Silicon. This fix is also needed in order to compile rasspy/piper on Apple silicon
speechPlayer: fix sample type qualification to avoid ambiguity
As reported in <https://bugs.freebsd.org/271486>, when the C++ standard
library provides std::sample, it causes a compile error when compiling
speechWaveGenerator.cpp:
src/speechPlayer/src/speechWaveGenerator.cpp:197:56: error: reference to 'sample' is ambiguous
unsigned int generate(const unsigned int sampleCount, sample* sampleBuf) {
^
src/speechPlayer/src/sample.h:23:3: note: candidate found by name lookup is 'sample'
} sample;
^
/usr/include/c++/v1/__algorithm/sample.h:95:17: note: candidate found by name lookup is 'std::sample'
_SampleIterator sample(_PopulationIterator __first,
^
Since speechWaveGenerator.cpp puts "using namespace std;" at the top,
fix the error by qualifying "sample" with an explicit "::".