Compile espeak in Windows

  • cnh

    Hi All,

    I new to espeak and new to programmer world and my question is that how to I compile espeak in Windows?

    Do I use Visual Studio (express edition)? or any other free alternative?

    The reason why I doing this is for my school project.

    Kindly advise and Thanks in advance.

    • How do you want to call eSpeak?

      There are three versions of eSpeak for Windows:
      1. Command line
      2. DLL (which you can call directly from your program).
      3. SAPI5 DLL (so you can use eSpeak in the Windows SAPI5 speech interface).

      In the espeak-source download, look in the directory  "platforms/windows".  The directories "windows_cmd", "windows_dll", "windows_sapi" contain Visual Studio project files for these three versions.

      I use Visual Studio C++ V6.  Visual Studio Express Edition probably works OK with these projects, but I'm not sure.  I don't know much about Windows.

    • Cameron Wong
      Cameron Wong

      I am trying to build the SAPI5 DLL with VC++ V6 and SAPI SDK 5.1.

      I downloaded the source package espeak-1.40.02-source, copied src\* to platforms\windows\windows_sapi\src except the speech.h, StdAfx.h and stdint.h.

      Then, I got following error when building the
      windows_sapi\TtsEngObj.cpp(425) : error C2039: 'WritePhonemes' : is not a member of 'CTTSEngObj'

      Any idea? Thanks!

      • The problem is an old version of ttsengobj.h

        It is correct in the SVN repository but not the in eSpeak downloads.  I have now fixed it in espeak version 1.40.20, at:

        You can also use the new version of ttsengobj.h OK with eSpeak version 1.40.02.

    • Cameron Wong
      Cameron Wong

      Here is more error information.

      --------------------Configuration: TtsEng - Win32 Release x86--------------------
      C:\lab\SAPI5\windows_sapi\TtsEngObj.h(27) : warning C4236: nonstandard extension used : '_export' is an obsolete keyword, see documentation for __declspec(dllexport)
      C:\lab\SAPI5\windows_sapi\TtsEngObj.cpp(425) : error C2039: 'WritePhonemes' : is not a member of 'CTTSEngObj'
              C:\lab\SAPI5\windows_sapi\TtsEngObj.h(60) : see declaration of 'CTTSEngObj'

    • silasoni

      if  there has a problem,why don't you update or fix it?
      your purpose is that make anybody to crazy?

  • LOGA

    i need espeak dll imediately! would u pls help me!

    i dnt know how to call dll

  • Yusuf Salman
    Yusuf Salman

    I cannot compile eSpeak on Windows. Anyone can help us?

  • shreekant

    I am trying to compile the source code on window xp machine.I have copied the source files into windows_cmd but when I build that code ,I am getting an error : LINK : fatal error LNK1104: cannot open file 'LIBC.lib'

    suggest any solution.

  • fred vs
    fred vs

    I try to compile espeak with mingw32.
    I need a portaudio19 compatible espeak.dll (not sapi).
    In /platform/windows i have done like said (copy from /src , etc …).
    But the makefile is the one for Linux !
    Where is the makefile for Windows ?

    What must i change in the original makefile to do a dll who uses  portaudio (not sapi).

    By the way, if it exists a already compiled dll of espeak ( using portaudio19), im happy too. ;-)

    PS : Is it possible to compile espeak with mingw32 ?
    PS2 : I have translated the C header of espeak.h into Pascal (fpc, Lazarus and Delphi).
    Working perfectly for Linux ( for Windows, i wait the portaudio version of espeak.dll to test it ).
    If somebody is interested… ;-)

    Many thanks

    • gilbert

      Hello, thank you very much for the proposal.
      I know your post is quite old but I'm really interested by your pascal header.
      I would also like to try a compilation for a futur attempt to make espeak able to use jack audio server (to redirect the sound into a DSP or whatever sound software)

    • Youka

      I've build v1.48.04 recently with mingw64. Espeak isn't really written for MinGW, there's more to do than following the instructions.

      After making a workcopy of the original sources, preparing a portaudio built and doing a copy of the actual portaudio.h into your sources, you have to apply changes described in patch file espeak_win_1_0.txt, but just those in Makefile and speech.h, the source files were already updated (strangely). Additionally compilation doesn't work because speech.h misses function Sleep (add windows header before sleep macro) and there's a redefinition of structure timespec in wave.cpp (just remove this copy). At the end, execute make how described in instructions with correct portaudio linkage.

      The result is just the DLL, no import library. dlltool helps:

      dlltool -z libespeak.def --export-all-symbols libespeak.dll
      dlltool -d libespeak.def -l libespeak.a

      The whole thing is quite big, so i rather suggest to build with MSVC. It's a C interface anyway.

      Last edit: Youka 2014-11-28