2 * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 * http://www.apache.org/licenses/LICENSE-2.0
7 * Unless required by applicable law or agreed to in writing, software
8 * distributed under the License is distributed on an "AS IS" BASIS,
9 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 * See the License for the specific language governing permissions and
11 * limitations under the License.
15 #ifndef __TTSD_AUDIO_OUT_H_
16 #define __TTSD_AUDIO_OUT_H_
21 #include <sound_manager.h>
30 AUDIO_STATE_WAIT_FOR_PLAYING,
37 int setAudioFormat(ttse_audio_type_e type, int rate);
38 int acquireSoundFocus();
39 int releaseSoundFocus();
40 int prepareAudioOut();
41 int unprepareAudioOut();
43 AudioState getState();
44 int playAudioData(char* buffer, unsigned int length);
47 static void focusStateChangedCallback(sound_stream_info_h stream_info, sound_stream_focus_mask_e focus_mask,
48 sound_stream_focus_state_e focus_state, sound_stream_focus_change_reason_e reason_for_change, int sound_behavior, const char *extra_info,
51 bool isAudioHandleValid();
52 bool isStreamInfoValid();
54 int createAudioHandle(ttse_audio_type_e type, int rate);
55 void destroyAudioHandle();
57 int createSoundStreamInfo();
58 void destroySoundStreamInfo();
61 audio_out_h mAudioHandle;
62 ttse_audio_type_e mAudioType;
66 sound_stream_info_h mStreamInfo;
73 #endif /* __TTSD_AUDIO_OUT_H_ */