Home | History | Annotate | Download | only in include
      1 /*---------------------------------------------------------------------------*
      2  *  SR_AcousticModels.h  *
      3  *                                                                           *
      4  *  Copyright 2007, 2008 Nuance Communciations, Inc.                               *
      5  *                                                                           *
      6  *  Licensed under the Apache License, Version 2.0 (the 'License');          *
      7  *  you may not use this file except in compliance with the License.         *
      8  *                                                                           *
      9  *  You may obtain a copy of the License at                                  *
     10  *      http://www.apache.org/licenses/LICENSE-2.0                           *
     11  *                                                                           *
     12  *  Unless required by applicable law or agreed to in writing, software      *
     13  *  distributed under the License is distributed on an 'AS IS' BASIS,        *
     14  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
     15  *  See the License for the specific language governing permissions and      *
     16  *  limitations under the License.                                           *
     17  *                                                                           *
     18  *---------------------------------------------------------------------------*/
     19 
     20 #ifndef __SR_ACOUSTICMODELS_H
     21 #define __SR_ACOUSTICMODELS_H
     22 
     23 
     24 
     25 
     26 #include <stddef.h>
     27 #include <stdlib.h>
     28 #include "SR_AcousticModelsPrefix.h"
     29 #include "pstdio.h"
     30 #include "ptypes.h"
     31 #include "ESR_ReturnCode.h"
     32 
     33 /**
     34  * AcousticModel ID.
     35  */
     36 typedef asr_uint8_t SR_AcousticModelID;
     37 
     38 /**
     39  * @addtogroup SR_AcousticModelsModule SR_AcousticModels API functions
     40  * Acoustic model collection.
     41  *
     42  * @{
     43  */
     44 
     45 /**
     46  * Acoustic model collection.
     47  */
     48 typedef struct SR_AcousticModels_t
     49 {
     50   /**
     51    * Destroys an AcousticModel collection.
     52    *
     53    * @param self SR_AcousticModels handle
     54    */
     55   ESR_ReturnCode(*destroy)(struct SR_AcousticModels_t* self);
     56   /**
     57    * Saves an AcousticModel collection to file.
     58    *
     59    * @param self SR_AcousticModels handle
     60    * @param filename File to write to
     61    * @deprecated Not supported
     62    */
     63   ESR_ReturnCode(*save)(struct SR_AcousticModels_t* self, const LCHAR* filename);
     64   /**
     65    * Sets AcousticModels parameter, overriding session defaults.
     66    *
     67    * @param self SR_AcousticModels handle
     68    * @param key Parameter name
     69    * @param value Parameter value
     70    */
     71   ESR_ReturnCode(*setParameter)(struct SR_AcousticModels_t* self, const LCHAR* key, LCHAR* value);
     72   /**
     73    * Returns AcousticModels parameter value.
     74    *
     75    * @param self SR_AcousticModels handle
     76    * @param key Parameter name
     77    * @param value [in/out] Parameter value
     78    * @param len [in/out] Length of value argument. If the return code is ESR_BUFFER_OVERFLOW,
     79    *            the required length is returned in this variable.
     80    */
     81   ESR_ReturnCode(*getParameter)(struct SR_AcousticModels_t* self, const LCHAR* key, LCHAR* value, size_t* len);
     82   /**
     83    * Returns the number of AcousticModels in the collection.
     84    *
     85    * @param self SR_AcousticModels handle
     86    * @param size The result
     87    */
     88   ESR_ReturnCode(*getCount)(struct SR_AcousticModels_t* self, size_t* size);
     89   /**
     90    * Returns modelID of a component.
     91    *
     92    * @param self SR_AcousticModels handle
     93    * @param index Index of model within collection (0-based)
     94    * @param id [out] Resulting model ID
     95    * @param size [in/out] Length of id argument. If the return code is ESR_BUFFER_OVERFLOW,
     96    *             the required length is returned in this variable.
     97    */
     98   ESR_ReturnCode(*getID)(struct SR_AcousticModels_t* self, size_t index, SR_AcousticModelID* id, size_t* size);
     99   /**
    100    * Sets the modelID of a component.
    101    *
    102    * @param self SR_AcousticModels handle
    103    * @param index Index of model within collection (0-based)
    104    * @param id New model ID
    105    */
    106   ESR_ReturnCode(*setID)(struct SR_AcousticModels_t* self, size_t index, SR_AcousticModelID* id);
    107   /**
    108    * Returns the arbdata (CA_Arbdata*) of a component.
    109    *
    110    * @param self SR_AcousticModels handle
    111    */
    112   void* (*getArbdata)(struct SR_AcousticModels_t* self);
    113 
    114 }
    115 SR_AcousticModels;
    116 
    117 /**
    118  * @name Models operations
    119  *
    120  * @{
    121  */
    122 
    123 /**
    124  * Destroys an AcousticModel collection.
    125  *
    126  * @param self SR_AcousticModels handle
    127  */
    128 SREC_ACOUSTICMODELS_API ESR_ReturnCode SR_AcousticModelsDestroy(SR_AcousticModels* self);
    129 /**
    130  * Loads an AcousticModel collection from file.
    131  *
    132  * @param filename File to read from
    133  * @param self SR_AcousticModels handle
    134  */
    135 SREC_ACOUSTICMODELS_API ESR_ReturnCode SR_AcousticModelsLoad(const LCHAR* filename,
    136                                                              SR_AcousticModels** self);
    137 /**
    138  * Saves an AcousticModel collection to file.
    139  *
    140  * @param self SR_AcousticModels handle
    141  * @param filename File to write to
    142  */
    143 SREC_ACOUSTICMODELS_API ESR_ReturnCode SR_AcousticModelsSave(SR_AcousticModels* self, const LCHAR* filename);
    144 /**
    145  * Sets AcousticModel parameter, overriding session defaults.
    146  *
    147  * @param self SR_AcousticModels handle
    148  * @param key Parameter name
    149  * @param value Parameter value
    150  */
    151 SREC_ACOUSTICMODELS_API ESR_ReturnCode SR_AcousticModelsSetParameter(SR_AcousticModels* self, const LCHAR* key, LCHAR* value);
    152 /**
    153  * Returns AcousticModel parameter value.
    154  *
    155  * @param self SR_AcousticModels handle
    156  * @param key Parameter name
    157  * @param value [out] Parameter value
    158  * @param len [in/out] Length of value argument. If the return code is ESR_BUFFER_OVERFLOW,
    159  *            the required length is returned in this variable.
    160  */
    161 SREC_ACOUSTICMODELS_API ESR_ReturnCode SR_AcousticModelsGetParameter(SR_AcousticModels* self, const LCHAR* key, LCHAR* value, size_t* len);
    162 /**
    163  * Returns the number of AcousticModels in the collection.
    164  *
    165  * @param self SR_AcousticModels handle
    166  * @param size The result
    167  */
    168 SREC_ACOUSTICMODELS_API ESR_ReturnCode SR_AcousticModelsGetCount(SR_AcousticModels* self, size_t* size);
    169 /**
    170  * Returns modelID of a component.
    171  *
    172  * @param self SR_AcousticModels handle
    173  * @param index Index of model within collection (0-based)
    174  * @param id [out] Resulting model ID
    175  * @param idLen [in/out] Length of id argument. If the return code is ESR_BUFFER_OVERFLOW, the
    176  *              required length is returned in this variable.
    177  */
    178 SREC_ACOUSTICMODELS_API ESR_ReturnCode SR_AcousticModelsGetID(SR_AcousticModels* self, size_t index, SR_AcousticModelID* id,  size_t* idLen);
    179 /**
    180  * Sets the modelID of a component.
    181  *
    182  * @param self SR_AcousticModels handle
    183  * @param index Index of model within collection (0-based)
    184  * @param id New model ID
    185  */
    186 SREC_ACOUSTICMODELS_API ESR_ReturnCode SR_AcousticModelsSetID(SR_AcousticModels* self, size_t index, SR_AcousticModelID* id);
    187 
    188 /**
    189  * @}
    190  */
    191 
    192 /**
    193  * @}
    194  */
    195 
    196 
    197 #endif /* __SR_ACOUSTICMODELS_H */
    198