From: Shaun Ren sren@codeweavers.com
Also introduce the piper TTS library. --- configure.ac | 13 +++++++++++++ dlls/msttsengine/Makefile.in | 2 ++ dlls/msttsengine/unixlib.c | 17 +++++++++++++++-- 3 files changed, 30 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac index 5a6594adbed..1e6a8d2cb8d 100644 --- a/configure.ac +++ b/configure.ac @@ -51,6 +51,7 @@ AC_ARG_WITH(oss, AS_HELP_STRING([--without-oss],[do not use the OSS sound AC_ARG_WITH(pcap, AS_HELP_STRING([--without-pcap],[do not use the Packet Capture library]), [if test "x$withval" = "xno"; then ac_cv_header_pcap_pcap_h=no; fi]) AC_ARG_WITH(pcsclite, AS_HELP_STRING([--without-pcsclite],[do not use PCSC lite])) +AC_ARG_WITH(piper, AS_HELP_STRING([--without-piper],[do not use the Piper TTS library])) AC_ARG_WITH(pthread, AS_HELP_STRING([--without-pthread],[do not use the pthread library])) AC_ARG_WITH(pulse, AS_HELP_STRING([--without-pulse],[do not use PulseAudio sound support])) AC_ARG_WITH(sane, AS_HELP_STRING([--without-sane],[do not use SANE (scanner support)])) @@ -1819,6 +1820,18 @@ fi WINE_NOTICE_WITH(vulkan,[test "x$ac_cv_lib_soname_vulkan" = "x" -a "x$ac_cv_lib_soname_MoltenVK" = "x"], [libvulkan and libMoltenVK ${notice_platform}development files not found, Vulkan won't be supported.])
+dnl **** Check for libpiper **** +if test "x$with_piper" != "xno" +then + WINE_PACKAGE_FLAGS(PIPER,[piper],[-lpiper],,, + [AC_CHECK_HEADER(piper/piper_c.h, + [AC_CHECK_LIB(piper,piperInitialize,[:],[PIPER_LIBS=""],[$PIPER_LIBS])], + [PIPER_LIBS=""])]) +fi +WINE_NOTICE_WITH(piper,[test "$ac_cv_lib_piper_piperInitialize" != "yes"], + [libpiper ${notice_platform}development files not found, TTS won't be supported.], + [enable_msttsengine]) + dnl **** Check for gcc specific options ****
if test "x${GCC}" = "xyes" diff --git a/dlls/msttsengine/Makefile.in b/dlls/msttsengine/Makefile.in index b6c9b9d27c2..9b64e684875 100644 --- a/dlls/msttsengine/Makefile.in +++ b/dlls/msttsengine/Makefile.in @@ -1,6 +1,8 @@ MODULE = msttsengine.dll UNIXLIB = msttsengine.so IMPORTS = ole32 +UNIX_CFLAGS = $(PIPER_CFLAGS) +UNIX_LIBS = $(PIPER_LIBS)
SOURCES = \ main.c \ diff --git a/dlls/msttsengine/unixlib.c b/dlls/msttsengine/unixlib.c index fc2cc23f836..864f97fa9a2 100644 --- a/dlls/msttsengine/unixlib.c +++ b/dlls/msttsengine/unixlib.c @@ -26,20 +26,33 @@ #include <stdlib.h> #include <unistd.h>
+#include <piper/piper_c.h> + #include "ntstatus.h" #define WIN32_NO_STATUS #include "winternl.h"
#include "ttseng_private.h"
+static inline Piper *get_piper(tts_t tts) +{ + return (Piper *)(ULONG_PTR)tts; +} + static NTSTATUS tts_create(void *args) { - return STATUS_NOT_IMPLEMENTED; + Piper *piper = piperInitialize(NULL); + + *(tts_t *)args = (tts_t)(ULONG_PTR)piper; + return piper ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL; }
static NTSTATUS tts_destroy(void *args) { - return STATUS_NOT_IMPLEMENTED; + Piper *piper = get_piper(*(tts_t *)args); + + piperTerminate(piper); + return STATUS_SUCCESS; }
const unixlib_entry_t __wine_unix_call_funcs[] =