| 1 | /* |
| 2 | * Copyright 2024 KylinSoft Co., Ltd. |
| 3 | * |
| 4 | * This program is free software: you can redistribute it and/or modify it under |
| 5 | * the terms of the GNU General Public License as published by the Free Software |
| 6 | * Foundation, either version 3 of the License, or (at your option) any later |
| 7 | * version. |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, but WITHOUT |
| 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
| 11 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
| 12 | * details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License along with |
| 15 | * this program. If not, see <https://www.gnu.org/licenses/>. |
| 16 | */ |
| 17 | |
| 18 | #ifndef __KYLIN_AI_SPEECH_RESULT_H__ |
| 19 | #define __KYLIN_AI_SPEECH_RESULT_H__cxx . . $ `include/kylin-ai/coreai/speech/result.h:19:9`! |
| 20 | |
| 21 | #include <common/macros.h> |
| 22 | #include <stdint.h> |
| 23 | |
| 24 | #ifdef __cpluspluscxx . . $ `<built-in>:470:9`! |
| 25 | extern "C" { |
| 26 | #endif |
| 27 | |
| 28 | typedef enum { |
| 29 | // 出错 |
| 30 | SPEECH_ERROR_OCCURRED = 1, |
| 31 | // 已启动语音识别 |
| 32 | SPEECH_RECOGNITION_STARTED = 2, |
| 33 | // 正在进行语音识别,中间结果 |
| 34 | SPEECH_RECOGNIZING = 3, |
| 35 | // 语音识别的最终结果,经过修正 |
| 36 | SPEECH_RECOGNIZED = 4, |
| 37 | // 语音识别完成 |
| 38 | SPEECH_RECOGNITION_COMPLETED = 5, |
| 39 | // 已启动语音合成 |
| 40 | SPEECH_SYNTHESIS_STARTED = 6, |
| 41 | // 正在进行语音合成,语音合成的结果输出 |
| 42 | SPEECH_SYNTHESIZING = 7, |
| 43 | // 语音合成已经完成 |
| 44 | SPEECH_SYNTHESIS_COMPLETED = 8, |
| 45 | } SpeechResultReason; |
| 46 | |
| 47 | typedef struct _SpeechRecognitionResultcxx . . $ _SpeechRecognitionResult# SpeechRecognitionResult; |
| 48 | |
| 49 | AISDK_EXTERNcxx . . $ `<external>/16012735566347328758/macros.h:21:9`! |
| 50 | SpeechResultReason speech_recognition_result_get_reason( |
| 51 | SpeechRecognitionResult *result); |
| 52 | |
| 53 | AISDK_EXTERNcxx . . $ `<external>/16012735566347328758/macros.h:21:9`! |
| 54 | const char *speech_recognition_result_get_text(SpeechRecognitionResult *result); |
| 55 | |
| 56 | AISDK_EXTERNcxx . . $ `<external>/16012735566347328758/macros.h:21:9`! |
| 57 | int speech_recognition_result_get_speaker_id(SpeechRecognitionResult *result); |
| 58 | |
| 59 | AISDK_EXTERNcxx . . $ `<external>/16012735566347328758/macros.h:21:9`! |
| 60 | int speech_recognition_result_get_error_code(SpeechRecognitionResult *result); |
| 61 | |
| 62 | AISDK_EXTERNcxx . . $ `<external>/16012735566347328758/macros.h:21:9`! |
| 63 | const char *speech_recognition_result_get_error_message( |
| 64 | SpeechRecognitionResult *result); |
| 65 | |
| 66 | typedef struct _SpeechSynthesisResultcxx . . $ _SpeechSynthesisResult# SpeechSynthesisResult; |
| 67 | |
| 68 | AISDK_EXTERNcxx . . $ `<external>/16012735566347328758/macros.h:21:9`! |
| 69 | SpeechResultReason speech_synthesis_result_get_reason( |
| 70 | SpeechSynthesisResult *result); |
| 71 | |
| 72 | AISDK_EXTERNcxx . . $ `<external>/16012735566347328758/macros.h:21:9`! |
| 73 | const char *speech_synthesis_result_get_audio_format( |
| 74 | SpeechSynthesisResult *result); |
| 75 | |
| 76 | AISDK_EXTERNcxx . . $ `<external>/16012735566347328758/macros.h:21:9`! |
| 77 | int speech_synthesis_result_get_audio_rate(SpeechSynthesisResult *result); |
| 78 | |
| 79 | AISDK_EXTERNcxx . . $ `<external>/16012735566347328758/macros.h:21:9`! |
| 80 | int speech_synthesis_result_get_audio_channel(SpeechSynthesisResult *result); |
| 81 | |
| 82 | AISDK_EXTERNcxx . . $ `<external>/16012735566347328758/macros.h:21:9`! |
| 83 | const uint8_tcxx . . $ uint8_t# *speech_synthesis_result_get_data(SpeechSynthesisResult *result, |
| 84 | uint32_tcxx . . $ uint32_t# *data_length); |
| 85 | |
| 86 | AISDK_EXTERNcxx . . $ `<external>/16012735566347328758/macros.h:21:9`! |
| 87 | int speech_synthesis_result_get_error_code(SpeechSynthesisResult *result); |
| 88 | |
| 89 | AISDK_EXTERNcxx . . $ `<external>/16012735566347328758/macros.h:21:9`! |
| 90 | const char *speech_synthesis_result_get_error_message( |
| 91 | SpeechSynthesisResult *result); |
| 92 | |
| 93 | typedef void (*SpeechRecognitionResultCallback)(SpeechRecognitionResult *result, |
| 94 | void *user_data); |
| 95 | typedef void (*SpeechSynthesisResultCallback)(SpeechSynthesisResult *result, |
| 96 | void *user_data); |
| 97 | |
| 98 | #ifdef __cpluspluscxx . . $ `<built-in>:470:9`! |
| 99 | } |
| 100 | #endif |
| 101 | |
| 102 | #endif |