piper icon indicating copy to clipboard operation
piper copied to clipboard

Ambiguous Reference to ‘sample’ in speechWaveGenerator.cpp, Termux

Open Manamama opened this issue 1 year ago • 1 comments

Environment:

  • Operating System: Android (Linux localhost 4.14.186+)
  • Architecture: aarch64
  • Compiler: Clang/Clang++
  • Linked Libraries: -lm -lpython3.11 -llog
  • Include Path: /data/data/com.termux/files/usr/lib/qt/mkspecs/common/uikit/:/data/data/com.termux/files/usr/include/epoxy/

Issue Description: During the compilation of piperTTS, an ambiguous reference error is thrown for ‘sample’ in speechWaveGenerator.cpp. The error occurs at line 197 and prevents successful compilation.

Error Message:

/data/data/com.termux/files/home/downloads/piperTTS/build/p/src/piper_phonemize_external-build/e/src/espeak_ng_external/src/speechPlayer/src/speechWaveGenerator.cpp:197:56: error: reference to 'sample' is ambiguous

Steps to Reproduce:

  1. Run the build process for piperTTS on the specified environment.
  2. Observe the compilation error at line 197 in speechWaveGenerator.cpp.

Expected Behavior: The code should compile without errors regarding ambiguous references.

Actual Behavior: Compilation fails due to an ambiguous reference to ‘sample’.

Additional Context: This issue has been persistent and previous attempts at resolving it by specifying namespaces have not been successful. Runs on prooted Debian though.

Manamama avatar Jun 18 '24 20:06 Manamama

Fixed it:

mkdir -p downloads/
cd downloads
git clone https://github.com/rhasspy/pipe
mkdir build 
cd build 

then e.g. my fancy: rm CMakeCache.txt & echo "Starting compilation 👩‍💻 proper..." && mkdir -p build && cd build && cmake -DCMAKE_CXX_FLAGS="$CXXFLAGS" -DCMAKE_INSTALL_PREFIX=$PREFIX .. && time make -j4 && make install -j4 && cd .. && termux-vibrate

It shall likely fail due to the above, still, AD 2025.

So:

sed -n '192,197p' /data/data/com.termux/files/home/downloads/piper/build/p/src/piper_phonemize_external-build/e/src/espeak_ng_external/src/speechPlayer/src/speechWaveGenerator.cpp
sed -i '197s/sample\* sampleBuf/::sample* sampleBuf/' /data/data/com.termux/files/home/downloads/piper/build/p/src/piper_phonemize_external-build/e/src/espeak_ng_external/src/speechPlayer/src/speechWaveGenerator.cpp
sed -n '192,197p' /data/data/com.termux/files/home/downloads/piper/build/p/src/piper_phonemize_external-build/e/src/espeak_ng_external/src/speechPlayer/src/speechWaveGenerator.cpp

as per: https://cgit.freebsd.org/ports/commit/?id=c7753b07bba7d1a4d1b60c8e83758ef25d909cc5

(But it is a hacky solution...)

NB. Adjust the path there, mine is absolute.

Ver. 2.0, new URL so new path

Manamama avatar Jun 20 '24 19:06 Manamama

Update, solved also other probs, see: https://github.com/rhasspy/piper/issues/814#issuecomment-3046847047

Manamama avatar Jul 08 '25 00:07 Manamama