00001 /* 00002 * Copyright 2008-2010 Arsen Chaloyan 00003 * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); 00005 * you may not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an "AS IS" BASIS, 00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 * 00016 * $Id: pocketsphinx_properties.h 1743 2010-07-12 08:04:46Z achaloyan $ 00017 */ 00018 00019 #ifndef POCKETSPHINX_PROPERTIES_H 00020 #define POCKETSPHINX_PROPERTIES_H 00021 00022 /** 00023 * @file pocketsphinx_properties.h 00024 * @brief PocketSphinx Properties 00025 */ 00026 00027 #include "apt_dir_layout.h" 00028 00029 APT_BEGIN_EXTERN_C 00030 00031 /** Enumeration of PocketSphinx models */ 00032 typedef enum { 00033 POCKETSPHINX_MODEL_NARROWBAND, /**< narrowband model */ 00034 POCKETSPHINX_MODEL_WIDEBAND /**< wideband model */ 00035 } pocketsphinx_model_e; 00036 00037 /** Declaration of PocketSphinx properties */ 00038 typedef struct pocketsphinx_properties_t pocketsphinx_properties_t; 00039 00040 /** PocketSphinx properties */ 00041 struct pocketsphinx_properties_t { 00042 /** Data directory */ 00043 const char *data_dir; 00044 /** Path to dictionary file */ 00045 const char *dictionary; 00046 /** Path to narrowband model */ 00047 const char *model_8k; 00048 /** Path to wideband model */ 00049 const char *model_16k; 00050 /** Preferred (default) model */ 00051 pocketsphinx_model_e preferred_model; 00052 00053 /** Sensitivity level */ 00054 apr_size_t sensitivity_level; 00055 /** Activity timeout (timeout to be used to switch to the activity state) */ 00056 apr_size_t activity_timeout; 00057 /** Inactivity timeout (timeout to be used to switch to the inactivity state) */ 00058 apr_size_t inactivity_timeout; 00059 00060 /** Noinput timeout */ 00061 apr_size_t no_input_timeout; 00062 /** Recognition timeout */ 00063 apr_size_t recognition_timeout; 00064 /** Partial result checking timeout */ 00065 apr_size_t partial_result_timeout; 00066 00067 /** Whether to save waveform or not */ 00068 apt_bool_t save_waveform; 00069 /** Directory to save waveform in */ 00070 const char *save_waveform_dir; 00071 }; 00072 00073 /** Load PocketSphinx properties */ 00074 apt_bool_t pocketsphinx_properties_load(pocketsphinx_properties_t *properties, 00075 const char *file_path, 00076 const apt_dir_layout_t *dir_layout, 00077 apr_pool_t *pool); 00078 00079 APT_END_EXTERN_C 00080 00081 #endif /* POCKETSPHINX_PROPERTIES_H */