ScummVM API documentation
emscripten-text-to-speech.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef BACKENDS_TEXT_TO_SPEECH_EMSCRIPTEN_H
23 #define BACKENDS_TEXT_TO_SPEECH_EMSCRIPTEN_H
24 
25 #include "common/scummsys.h"
26 
27 #if defined(USE_TTS) && defined(EMSCRIPTEN)
28 
29 #include "common/list.h"
30 #include "common/str.h"
31 #include "common/text-to-speech.h"
32 #include "common/ustr.h"
33 
34 class EmscriptenTextToSpeechManager final : public Common::TextToSpeechManager {
35 public:
36  EmscriptenTextToSpeechManager();
37  ~EmscriptenTextToSpeechManager() override;
38 
39  bool say(const Common::U32String &str, Action action) override;
40 
41  bool stop() override;
42  bool pause() override;
43  bool resume() override;
44 
45  bool isSpeaking() override;
46  bool isPaused() override;
47  bool isReady() override;
48 
49  void setVoice(unsigned index) override;
50 
51  void setRate(int rate) override;
52 
53  void setPitch(int pitch) override;
54 
55  void setVolume(unsigned volume) override;
56 
57  void setLanguage(Common::String language) override;
58 
59  void freeVoiceData(void *data) override;
60 
61  void updateVoicesPublic() { updateVoices(); };
62 
63 private:
64  void updateVoices() override;
65 };
66 
67 #endif
68 
69 #endif // BACKENDS_TEXT_TO_SPEECH_EMSCRIPTEN_H
Definition: str.h:59
virtual void setRate(int rate)
Definition: text-to-speech.h:263
virtual bool stop()
Definition: text-to-speech.h:215
virtual void setVoice(unsigned index)
Definition: text-to-speech.h:251
virtual void freeVoiceData(void *data)
Definition: text-to-speech.h:343
virtual bool isSpeaking()
Definition: text-to-speech.h:234
virtual void setVolume(unsigned volume)
Definition: text-to-speech.h:287
virtual bool say(const U32String &str, Action action)
Definition: text-to-speech.h:183
virtual void setPitch(int pitch)
Definition: text-to-speech.h:275
virtual bool isReady()
Definition: text-to-speech.h:244
Definition: ustr.h:57
virtual bool pause()
Definition: text-to-speech.h:220
virtual void setLanguage(String language)
Definition: text-to-speech.h:150
virtual bool resume()
Definition: text-to-speech.h:229
virtual bool isPaused()
Definition: text-to-speech.h:239