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 1474 2010-02-07 20:51:47Z 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 /** Sensitivity timeout */ 00056 apr_size_t sensitivity_timeout; 00057 00058 /** Noinput timeout */ 00059 apr_size_t no_input_timeout; 00060 /** Recognition timeout */ 00061 apr_size_t recognition_timeout; 00062 /** Partial result checking timeout */ 00063 apr_size_t partial_result_timeout; 00064 00065 /** Whether to save waveform or not */ 00066 apt_bool_t save_waveform; 00067 /** Directory to save waveform in */ 00068 const char *save_waveform_dir; 00069 }; 00070 00071 /** Load PocketSphinx properties */ 00072 apt_bool_t pocketsphinx_properties_load(pocketsphinx_properties_t *properties, 00073 const char *file_path, 00074 const apt_dir_layout_t *dir_layout, 00075 apr_pool_t *pool); 00076 00077 APT_END_EXTERN_C 00078 00079 #endif /* POCKETSPHINX_PROPERTIES_H */
1.6.2