eSpeak NG is an open source speech synthesizer that supports more than hundred languages and accents.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ttseng.cpp 2.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. // TtsEng.cpp : Implementation of DLL Exports.
  2. //Copyright (c) Microsoft Corporation. All rights reserved.
  3. // Note: Proxy/Stub Information
  4. // To build a separate proxy/stub DLL,
  5. // run nmake -f msttsdrvps.mk in the project directory.
  6. #include "stdafx.h"
  7. #include "resource.h"
  8. #include <initguid.h>
  9. #include "TtsEng.h"
  10. #include "TtsEng_i.c"
  11. #include "TtsEngObj.h"
  12. CComModule _Module;
  13. BEGIN_OBJECT_MAP(ObjectMap)
  14. OBJECT_ENTRY( CLSID_SampleTTSEngine , CTTSEngObj )
  15. END_OBJECT_MAP()
  16. /////////////////////////////////////////////////////////////////////////////
  17. // DLL Entry Point
  18. #ifdef _WIN32_WCE
  19. extern "C" BOOL WINAPI DllMain(HANDLE hInstance, ULONG dwReason, LPVOID)
  20. #else
  21. extern "C" BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
  22. #endif
  23. {
  24. if (dwReason == DLL_PROCESS_ATTACH)
  25. {
  26. _Module.Init(ObjectMap, (HINSTANCE)hInstance, &LIBID_SAMPLETTSENGLib);
  27. }
  28. else if (dwReason == DLL_PROCESS_DETACH)
  29. _Module.Term();
  30. return TRUE; // ok
  31. }
  32. /////////////////////////////////////////////////////////////////////////////
  33. // Used to determine whether the DLL can be unloaded by OLE
  34. STDAPI DllCanUnloadNow(void)
  35. {
  36. return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
  37. }
  38. /////////////////////////////////////////////////////////////////////////////
  39. // Returns a class factory to create an object of the requested type
  40. STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
  41. {
  42. return _Module.GetClassObject(rclsid, riid, ppv);
  43. }
  44. /////////////////////////////////////////////////////////////////////////////
  45. // DllRegisterServer - Adds entries to the system registry
  46. STDAPI DllRegisterServer(void)
  47. {
  48. // registers object, typelib and all interfaces in typelib
  49. return _Module.RegisterServer(TRUE);
  50. }
  51. /////////////////////////////////////////////////////////////////////////////
  52. // DllUnregisterServer - Removes entries from the system registry
  53. STDAPI DllUnregisterServer(void)
  54. {
  55. return _Module.UnregisterServer(TRUE);
  56. }