Add recorder destroy when bt recording is failed
[platform/core/uifw/stt.git] / server / sttd_recorder.h
1 /*
2 *  Copyright (c) 2011-2016 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.
12 */
13
14
15 #ifndef __STTD_RECORDER_H__
16 #define __STTD_RECORDER_H__
17
18 #include "stte.h"
19
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23
24
25 typedef int (*stt_recorder_audio_cb)(const void* data, const unsigned int length);
26
27 typedef void (*stt_recorder_interrupt_cb)();
28
29 int sttd_recorder_initialize(stt_recorder_audio_cb audio_cb, stt_recorder_interrupt_cb interrupt_cb);
30
31 int sttd_recorder_deinitialize();
32
33 int sttd_recorder_set_audio_session();
34
35 int sttd_recorder_unset_audio_session();
36
37 int sttd_recorder_create(stte_audio_type_e type, int channel, unsigned int sample_rate);
38
39 int sttd_recorder_destroy();
40
41 int sttd_recorder_start(int uid);
42
43 int sttd_recorder_stop();
44
45 int sttd_recorder_start_file(int uid, const char *filepath);
46
47 int sttd_recorder_stop_file();
48
49 int sttd_recorder_reset();
50
51 #ifdef __cplusplus
52 }
53 #endif
54
55 #endif  /* __STTD_RECORDER_H__ */
56