1 // Copyright (c) 2014 Samsung Electronics Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef BROWSER_SPEECH_TTS_TIZEN_H_
6 #define BROWSER_SPEECH_TTS_TIZEN_H_
8 #include "build/tizen_version.h"
10 typedef int tts_voice_type_e;
12 #include "content/browser/speech/tts_message_filter_efl.h"
13 #include "content/common/tts_utterance_request_efl.h"
19 class TtsMessageFilterEfl;
21 // TtsTizen is the class that actually communicate with tts engine.
22 // It handles tts instance, callbacks and callback returns
25 TtsTizen(TtsMessageFilterEfl* tts_message_filter_efl);
30 const std::vector<TtsVoice>& GetVoiceList();
31 void Speak(const TtsUtteranceRequest& utterance);
35 tts_h GetTTS() { return tts_handle_; }
36 TtsMessageFilterEfl* GetTtsMessageFilterEfl() {
37 return tts_message_filter_efl_; }
38 const TtsUtteranceRequest& GetUtterance() const { return utterance_; }
41 // Get voices one by one from tts engine, append them into a voice list
42 void AddVoice(std::string language, tts_voice_type_e name);
43 bool IsTtsInitialized() const { return tts_initialized_; }
46 // Create and Set tts and tts callback. If any of these failes, tts will not work at all.
47 bool SetTtsCallback();
48 void StoreTtsDefaultVoice();
49 void SpeakStoredUtterance();
50 TtsMessageFilterEfl* tts_message_filter_efl_;
51 TtsUtteranceRequest utterance_;
53 std::string default_language_;
54 tts_voice_type_e default_voice_;
56 // This variable stores list of voicees that tts engine support.
57 std::vector<TtsVoice> voice_list_;
59 // This variable check whether tts is initialized.
60 // It will be true when tts engine set the variable tts_.
61 bool tts_initialized_;
63 // This variable check whether tts is ready, after initialized.
64 // Initial value is false and it will be true when tts state change to
65 // TTS_STATE_CREATED && TTS_STATE_READY.
66 bool tts_state_ready_;
68 // This variable check whether any utterance is currently wating to speak.
69 bool utterance_waiting_;
72 } // namespace content
74 #endif // BROWSER_SPEECH_TTS_TIZEN_H_