2 * Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #ifndef __TTS_INTERNAL_H__
19 #define __TTS_INTERNAL_H__
31 * @brief Sets server tts.
32 * @details Using this API, the application can ask server tts with a credential.
33 * The credential is a key to verify the authorization about using the engine based on server, not embeded engine.
34 * If the application sets the credential, it will be able to use functions of the server engine entirely.
35 * @since_tizen @if MOBILE 3.0
37 * @remarks The necessity of the credential depends on the engine. In case of the engine which is basically embedded in Tizen, the credential is not necessary so far.
38 * However, if the user wants to apply the 3rd party's engine, the credential may be necessary. In that case, please follow the policy provided by the corresponding engine.
40 * @param[in] tts The TTS handle
41 * @param[in] credential The credential
43 * @return 0 on success, otherwise a negative error value
44 * @retval #TTS_ERROR_NONE Success
45 * @retval #TTS_ERROR_INVALID_STATE Invalid state
46 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
47 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
48 * @retval #TTS_ERROR_OUT_OF_MEMORY TTS Out of memory
50 * @pre The state should be #TTS_STATE_CREATED or #TTS_STATE_READY.
54 int tts_set_server_tts(tts_h tts, const char* credential);
57 * @brief Adds a sound stream to the queue.
60 * @param[in] tts The TTS handle
61 * @param[in] event An event about pcm buffer (-1: error, 1: start, 2: continue, 3: finish)
62 * @param[in] data The pcm data buffer
63 * @param[in] data_size The data size of pcm data buffer
64 * @param[in] audio_type The audio type of pcm (0: signed 16-bit, 1: unsigned 8-bit)
65 * @param[in] rate The sampling rate of pcm
66 * @return @c 0 on success,
67 * otherwise a negative error value
68 * @retval #TTS_ERROR_NONE Successful
69 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
70 * @retval #TTS_ERROR_INVALID_STATE Invalid state
71 * @retval #TTS_ERROR_OPERATION_FAILED Operation failure
72 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
73 * @retval #TTS_ERROR_PERMISSION_DENIED Permission denied
74 * @pre The state should be #TTS_STATE_PLAYING.
78 int tts_add_pcm(tts_h tts, int event, const void* data, unsigned int data_size, int audio_type, int rate);
81 * @brief Request to play pcm.
84 * @param[in] tts The TTS handle
85 * @return @c 0 on success,
86 * otherwise a negative error value
87 * @retval #TTS_ERROR_NONE Successful
88 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
89 * @retval #TTS_ERROR_INVALID_STATE Invalid state
90 * @retval #TTS_ERROR_OPERATION_FAILED Operation failure
91 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
92 * @retval #TTS_ERROR_PERMISSION_DENIED Permission denied
93 * @pre The state should be #TTS_STATE_READY.
97 int tts_play_pcm(tts_h tts);
100 * @brief Request to stop pcm.
103 * @param[in] tts The TTS handle
104 * @return @c 0 on success,
105 * otherwise a negative error value
106 * @retval #TTS_ERROR_NONE Successful
107 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
108 * @retval #TTS_ERROR_INVALID_STATE Invalid state
109 * @retval #TTS_ERROR_OPERATION_FAILED Operation failure
110 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
111 * @retval #TTS_ERROR_PERMISSION_DENIED Permission denied
112 * @pre The state should be #TTS_STATE_PLAYING.
113 * @see tts_play_pcm()
116 int tts_stop_pcm(tts_h tts);
126 #endif /* __TTS_INTERNAL_H__ */