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__
32 * @brief Definition for TTS interrupt mode
34 #define TTS_MODE_INTERRUPT 3
38 * @brief Sets server tts.
39 * @details Using this API, the application can ask server tts with a credential.
40 * The credential is a key to verify the authorization about using the engine based on server, not embedded engine.
41 * If the application sets the credential, it will be able to use functions of the server engine entirely.
44 * @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.
45 * 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.
47 * @param[in] tts The TTS handle
48 * @param[in] credential The credential
50 * @return 0 on success, otherwise a negative error value
51 * @retval #TTS_ERROR_NONE Success
52 * @retval #TTS_ERROR_INVALID_STATE Invalid state
53 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
54 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
55 * @retval #TTS_ERROR_OUT_OF_MEMORY TTS Out of memory
57 * @pre The state should be #TTS_STATE_CREATED or #TTS_STATE_READY.
61 int tts_set_server_tts(tts_h tts, const char* credential);
64 * @brief Adds a sound stream to the queue.
67 * @param[in] tts The TTS handle
68 * @param[in] event An event about pcm buffer (-1: error, 1: start, 2: continue, 3: finish)
69 * @param[in] data The pcm data buffer
70 * @param[in] data_size The data size of pcm data buffer
71 * @param[in] audio_type The audio type of pcm (0: signed 16-bit, 1: unsigned 8-bit)
72 * @param[in] rate The sampling rate of pcm
73 * @return @c 0 on success,
74 * otherwise a negative error value
75 * @retval #TTS_ERROR_NONE Successful
76 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
77 * @retval #TTS_ERROR_INVALID_STATE Invalid state
78 * @retval #TTS_ERROR_OPERATION_FAILED Operation failure
79 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
80 * @retval #TTS_ERROR_PERMISSION_DENIED Permission denied
81 * @pre The state should be #TTS_STATE_READY, #TTS_STATE_PLAYING, or #TTS_STATE_PAUSED.
85 int tts_add_pcm(tts_h tts, int event, const void* data, unsigned int data_size, int audio_type, int rate);
88 * @brief Request to play pcm.
91 * @param[in] tts The TTS handle
92 * @return @c 0 on success,
93 * otherwise a negative error value
94 * @retval #TTS_ERROR_NONE Successful
95 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
96 * @retval #TTS_ERROR_INVALID_STATE Invalid state
97 * @retval #TTS_ERROR_OPERATION_FAILED Operation failure
98 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
99 * @retval #TTS_ERROR_PERMISSION_DENIED Permission denied
100 * @pre The state should be #TTS_STATE_READY or #TTS_STATE_PAUSED.
102 * @see tts_stop_pcm()
104 int tts_play_pcm(tts_h tts);
107 * @brief Request to stop pcm.
110 * @param[in] tts The TTS handle
111 * @return @c 0 on success,
112 * otherwise a negative error value
113 * @retval #TTS_ERROR_NONE Successful
114 * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
115 * @retval #TTS_ERROR_INVALID_STATE Invalid state
116 * @retval #TTS_ERROR_OPERATION_FAILED Operation failure
117 * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
118 * @retval #TTS_ERROR_PERMISSION_DENIED Permission denied
119 * @pre The state should be #TTS_STATE_READY, #TTS_STATE_PLAYING, or #TTS_STATE_PAUSED.
120 * @see tts_play_pcm()
123 int tts_stop_pcm(tts_h tts);
133 #endif /* __TTS_INTERNAL_H__ */