1 #ifndef __DALI_TTS_PLAYER_H__
2 #define __DALI_TTS_PLAYER_H__
5 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/public-api/object/base-handle.h>
27 namespace Internal DALI_INTERNAL
36 * @brief The Text-to-speech Player.
38 class DALI_IMPORT_API TtsPlayer : public BaseHandle
43 * @brief Enumeration of TTS mode.
47 DEFAULT = 0, ///< Default mode for normal application
48 NOTIFICATION, ///< Notification mode
49 SCREEN_READER, ///< Screen reader mode
56 * @brief Create an uninitialized handle.
58 * This can be initialized by calling TtsPlayer::Get().
63 * @brief Gets the singleton of the TtsPlayer for each mode.
65 * Internally, each tts player handles (singleton instance) are managed for each mode.
66 * @param mode the mode of tts-player
67 * @return A handle of the Ttsplayer for given mode.
69 static TtsPlayer Get(Dali::TtsPlayer::Mode mode = Dali::TtsPlayer::DEFAULT);
74 * This is non-virtual since derived Handle types must not contain data or virtual methods.
79 * @brief This copy constructor is required for (smart) pointer semantics.
81 * @param [in] handle A reference to the copied handle
83 TtsPlayer(const TtsPlayer& handle);
86 * @brief This assignment operator is required for (smart) pointer semantics.
88 * @param [in] rhs A reference to the copied handle
89 * @return A reference to this
91 TtsPlayer& operator=(const TtsPlayer& rhs);
94 * @brief Start playing the audio data synthesized from the specified text.
96 * @pre The TtsPlayer needs to be initialized.
97 * @param[in] text to play.
99 void Play(const std::string& text);
102 * @brief Stops playing the utterance.
103 * @pre The TtsPlayer needs to be initialized.
108 * @brief Pauses the currently playing utterance.
109 * @pre The TtsPlayer needs to be initialized.
114 * @brief Resumes the previously paused utterance.
115 * @pre The TtsPlayer needs to be initialized.
119 public: // Not intended for application developers
122 * @brief This constructor is used by TtsPlayer::Get().
123 * @param[in] ttsPlayer A pointer to the TTS player.
125 explicit DALI_INTERNAL TtsPlayer( Internal::Adaptor::TtsPlayer* ttsPlayer );
130 #endif // __DALI_TTS_PLAYER_H__