trekspeech.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*==========================================================================
  2. *
  3. * Copyright (C) 1997 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: TrekSpeech.h
  6. *
  7. * Purpose:
  8. * Class for handling text to speech. Requires an externally initialized
  9. * DirectSound object, and the presence of a text to speech engine.
  10. *
  11. * Author: Terri Watson
  12. *
  13. *==========================================================================*/
  14. #ifndef __TrekSpeech__
  15. #define __TrekSpeech__
  16. #include <dsound.h>
  17. #include "speech.h"
  18. class TrekSpeech {
  19. private:
  20. boolean m_HaveSpeech; // No problems w/ speech set-up
  21. PIAUDIODIRECT m_pIAD; // AudioDirect interface (an audio
  22. // destination for use with DirectSound)
  23. public:
  24. PITTSCENTRAL m_pITTSCentral; // TTSCentral interface
  25. TTSMODEINFO m_TTSModeInfo; // Desired engine characteristics
  26. TrekSpeech();
  27. ~TrekSpeech();
  28. //===============
  29. // Set-up methods
  30. //===============
  31. HRESULT InitAudioDest(LPDIRECTSOUND lpDS); // required DirectSound obj
  32. HRESULT InitAudioDestination(LPDIRECTSOUND lpDS); // required DirectSound obj
  33. void desiredGender(WORD wGender); // optional gender request
  34. HRESULT SelectTTSEngine(); // optional
  35. // SayText will call SelectTTSEngine() if needed, but it may save delay
  36. // if the setup code calls this. If non-default characteristics are
  37. // desired, set them up PRIOR to calling SelectTTSEngine() or SayText().
  38. //======
  39. // Speak
  40. HRESULT SayText(char *text);
  41. };
  42. // Global until I find a home for the speech object
  43. extern TrekSpeech g_TrekSpeech;
  44. #define TRYSAYTEXT(text) g_TrekSpeech.SayText(text)
  45. #endif // __TrekSpeech__