From 8c48382a411a0c16f1d1cf7d015ea921f1adb2d0 Mon Sep 17 00:00:00 2001 From: Stefan Wildemann Date: Fri, 5 May 2017 20:03:51 +0200 Subject: Add: Add speech module using espeak on QMultimedia. (#233) * Add: Add speech module using (external) espeak on QMultimedia. * Add: Find system espeak or use internal one This patch adds a cmake module to find installed libespeak. If not found, it builds against included libespeak, despite it being heavily patched. * Fix: allow building internal espeak for posix systems Allow the usage of the internal (ported to C) version of espeak as replacement for system installed libespeak. * Fix: use synchronous espeak mode if internal espeak is used * Fix: Clear buffer if samples are played * Fix: use syncronous mode always, as QBuffer is not thread safe * Sailfish: Use qt5_espeak * Remove espeak shell script now obsolete * Fix: remove the espeak script from the repo * Fix: code cleanup. Fix audio buffer size * Fix: apply coding style Apply automatic coding style with 'clang-format -style=WebKit -i' * Fix; restore correct include file order Seems, our internal include files depend on correct order. This usually is a bad thing and we should consider fixing them. But this is another story... * Add qtmultimedia-dev to windows build for qt5_espeak * Rename CMake INTERNAL_ESPEAK -> INTERNAL_ESPEAK_COMPLETE --- cmake/Findespeak.cmake | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 cmake/Findespeak.cmake (limited to 'cmake') diff --git a/cmake/Findespeak.cmake b/cmake/Findespeak.cmake new file mode 100644 index 000000000..6d390a9a8 --- /dev/null +++ b/cmake/Findespeak.cmake @@ -0,0 +1,29 @@ +# - Try to find espeak (with libespeak) +# Once done, this will define +# +# espeak_FOUND - system has Glib +# espeak_INCLUDE_DIRS - the Glib include directories +# espeak_LIBRARIES - link these to use Glib + +include(LibFindMacros) + +# espeak-related libraries +find_path(espeak_INCLUDE_DIR + NAMES speak_lib.h + PATHS /usr /sw/include + PATH_SUFFIXES espeak +) + +# Finally the library itself +find_library(espeak_LIBRARY + NAMES libespeak.so libespeak.a + PATHS /sw/lib +) + +# Set the include dir variables and the libraries and let libfind_process do the rest. +# NOTE: Singular variables for this library, plural for libraries this this lib depends on. +set(espeak_PROCESS_INCLUDES espeak_INCLUDE_DIR) +set(espeak_PROCESS_LIBS espeak_LIBRARY) +libfind_process(espeak) + + -- cgit v1.2.1