Template
speech.h
Go to the documentation of this file.
1/*
2-----------------------------------------------------------------------------
3This source file is part of OpenSpace3D
4For the latest info, see http://www.openspace3d.com
5
6Copyright (c) 2012 I-maginer
7
8This program is free software; you can redistribute it and/or modify it under
9the terms of the GNU Lesser General Public License as published by the Free Software
10Foundation; either version 2 of the License, or (at your option) any later
11version.
12
13This program is distributed in the hope that it will be useful, but WITHOUT
14ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
16
17You should have received a copy of the GNU Lesser General Public License along with
18this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19Place - Suite 330, Boston, MA 02111-1307, USA, or go to
20http://www.gnu.org/copyleft/lesser.txt
21
22-----------------------------------------------------------------------------
23*/
24
25
34#ifndef __SPEECH_H__
35#define __SPEECH_H__
36
38#include <sapi.h>
39#include <sphelper.h>
40#include <spuihelp.h>
41#include <mlang.h>
42
45class Speech
46{
47public:
48protected:
49private:
50 CComPtr<ISpVoice> pVoice;
51 BOOL m_bPause;
52 BOOL m_bStop;
53 long m_DefaultRate;
54 USHORT m_DefaultVolume;
55 std::string s_text;
56 std::string m_buffer;
57
58public:
61 Speech();
62
65 ~Speech();
66
69 void SetSpeechText(std::string text);
70
73 void play();
74
77 void pause(bool state);
78
81 void stop();
82
85 int getVolumeSpeech();
86
89 void setVolumeSpeech(int volumeSpeech);
90
93 int getRateSpeech();
94
97 void setRateSpeech(int rateSpeech);
98
101 void callbackEvent();
102
105 std::list <char*> getVoices(int voiceType);
106
109 void SetSpeechVoice(std::string voice);
110
113 std::string getSpeechVoice();
114protected:
115private:
116};
117
118#endif
void SetSpeechVoice(std::string voice)
To set the speech voice.
Definition speech.cpp:366
void stop()
To stop the speech instance.
Definition speech.cpp:238
std::string getSpeechVoice()
To get the speech voice.
Definition speech.cpp:411
void callbackEvent()
Speech Callback function.
Definition speech.cpp:80
std::list< char * > getVoices(int voiceType)
To get the speech voices.
Definition speech.cpp:313
int getVolumeSpeech()
To get the speech volume.
Definition speech.cpp:271
void SetSpeechText(std::string text)
To set the speech text.
Definition speech.cpp:168
void setRateSpeech(int rateSpeech)
To set the speech rate.
Definition speech.cpp:306
void setVolumeSpeech(int volumeSpeech)
To set the speech volume.
Definition speech.cpp:285
int getRateSpeech()
To get the speech rate.
Definition speech.cpp:292
Speech()
Speech Constructor.
Definition speech.cpp:45
void play()
To play the speech instance.
Definition speech.cpp:175
void pause(bool state)
To pause/resume the speech instance.
Definition speech.cpp:214
~Speech()
Speech Destructor.
Definition speech.cpp:159