|
BSAPI
|
00001 00034 #ifndef _BSAPI_H 00035 #define _BSAPI_H 00036 00042 #ifndef _BSAPI_LITE_H 00043 #define SIID_UNDEFINED 0 ///< The interface does not exist 00044 #define SIID_UNKNOWN 1 ///< SUnknownI - unknown interface (an abstract interface) 00045 #endif 00046 #define SIID_LICENSEMANAGER 2 ///< SLicenseManagerI - license manager 00047 #define SIID_WFFORMATCONVERT 3 ///< SWaveformFormatConvertorI - waveform format convertor 00048 #define SIID_CHANSPLIT 4 ///< SChannelSplitterI -channel splitter 00049 #define SIID_CHANSET 11 ///< SChannelSetterI - channel setter 00050 #define SIID_GRAMCOMPGROUP 12 ///< SGrammarCompilerGroupI - group of grammar compilers 00051 #define SIID_PHNTRANS 15 ///< SPhnTransI - grapheme to phoneme convertor (uses both lexicon and G2P) 00052 #define SIID_LEXICON 16 ///< SLexiconI - lexicon - word, phoneme transcription 00053 #define SIID_G2P 17 ///< SG2PI - grapheme to phoneme generator 00054 #define SIID_FLOATMATRIX 18 ///< SFloatMatrixI - matrix of floats (usually features) 00055 #define SIID_CONFIGURE 19 ///< SConfigureI - configuration 00056 #define SIID_FMINSEARCH1D 22 ///< SFMinSearch1DI - search for minimum of 1D function 00057 #define SIID_PWFUNC2D 23 ///< SPieceWiseFunc2DI - Evaluate 2D function aproximated by a table 00058 #define SIID_GMMESTIMATOR 24 ///< SGMMBasedEstimatorI - GMM based estimator (for fast VTLN, GID, etc.) 00059 #define SIID_VTLNOFFLINE 26 ///< SVtlnOfflineI - search for optimal frequency warping factor 00060 #define SIID_EREST 29 ///< SERestI - STK SERest - model reestimation tool 00061 #define SIID_FILELIST 30 ///< SFileListI - file list processing 00062 #define SIID_FILESNIFFER 31 ///< SFileSnifferI - file sniffer - scans periodically directories for files 00063 #define SIID_FILELOCK 71 ///< SFileLockI - Provides file locking facility 00064 #define SIID_ASYNCFUNC 32 ///< SAsyncFuncI - asynchronous function calling (in separate thread) 00065 #define SIID_WFFILTER 33 ///< SWaveformFilterI - waveform filter 00066 #define SIID_SPEECHREC 34 ///< SSpeechRecI - full speech recognizer 00067 #define SIID_WAVEFORMMEMORY 35 ///< SWaveformMemoryI - waveform memory - an object which remembers waveform buffers 00068 #define SIID_WAVEFORMSEGMENTER 58 ///< SWaveformSegmenterI - waveform segmenter 00069 #define SIID_TRANSCMEMORY 36 ///< STranscriptionMemoryI - transcription memory - an object that remembers transcription (labels) 00070 #define SIID_FEATUREMEMORY 37 ///< SFeatureMemoryI - feature memory - an object that remembers feature matrix 00071 #define SIID_FEATURESEGMENTER 57 ///< SFeatureSegmenterI - feature segmenter 00072 #define SIID_FEATUREJOINER 27 ///< SFeatureJoinerI - join features segments to one matrix 00073 #define SIID_SIGNALMODELLING 38 ///< SSignalModellingI - signal modelling system 00074 #define SIID_LID 39 ///< SLIDI - language identification system 00075 #define SIID_LID2 128 ///< SLID2I - language identification system 00076 #define SIID_SPKID 40 ///< SSpeakerIDI - speaker identification system 00077 #define SIID_SPKID2 116 ///< SSpeakerID2I - speaker identification system 00078 #define SIID_GENDERID 52 ///< SGenderIDI - gender identification system 00079 #define SIID_GENDERID2 130 ///< SGenderID2I - gender identification system 00080 #define SIID_GMM 41 ///< SGMMI - Gaussian mixture model 00081 #define SIID_GMMLIST 42 ///< SGMMListI - list of Gaussian mixture models 00082 #define SIID_MATRIX 43 ///< SMatI - matrix class 00083 #define SIID_INTMATRIX 44 ///< SIntMatrixI - matrix of integers 00084 #define SIID_SFPRESEL 45 ///< SSpeechFilePreselectorI - speech file preselection system 00085 #define SIID_FWPLAY 46 ///< SFileWaveformPlayerI - audio file playback 00086 #define SIID_WAVEFORMSPLITTER 47 ///< SWaveformSplitterI - splits waveform stream to more callback functions 00087 #define SIID_TRANSCSPLITTER 48 ///< STranscriptionSplitterI - splits transcription stream to more callback functions 00088 #define SIID_TRANSCDISTRIB 110 ///< STranscriptionDistributerI - distributes transcription to the specific target depending on container type 00089 #define SIID_BLOCKSET 49 ///< SBlockSetI - creates and links blocks according to a config file 00090 #define SIID_OFFLINESREC1 50 ///< SOfflineSpeechRecognizerI - offline speech recognizer with segmentation, per file mean and variance normalization and VTLN 00091 #define SIID_OFFLINESREC2 51 ///< SOfflineSpeechRecognizerI - offline speech recognizer with segmentation, per file mean and variance normalization and VTLN, for use with blockset 00092 #define SIID_OFFLINESREC3 952 ///< SOfflineSpeechRecognizer3I - offline speech recognizer (produces OneBest, Lattice and ConfusionNetworks transcripts) 00093 #define SIID_ONLINESREC1 53 ///< SOnlineSpeechRecognizerI - online (microphone) speech recognizer with calibration 00094 #define SIID_ISOLATEDWORDREC 72 ///< SIsolatedWordRecognizerI - isolated word recognizer 00095 #define SIID_PRONUNCIATION 54 ///< SPronunciationI - one pronunciation variant in pronunciation list 00096 #define SIID_PRONLIST 55 ///< SPronunciationListI - list of pronunciation variants 00097 #define SIID_CHARSET 56 ///< SCharSetI - conversion between charsets and charset dependent string functions 00098 #define SIID_PHNLABEXP 59 ///< SPhoneticLabelExpansionI - expands phonemes to triphones 00099 #define SIID_FEATURESPLITTER 60 ///< SFeatureSplitterI - splits feature stream to more callback functions 00100 #define SIID_FEAPASTE 61 ///< SFeaPasteI - pastes two streams of feature matrices to one. Similar to GNU paste. 00101 #define SIID_PARAMSPLITTER 62 ///< SParametersSplitterI - splits parameters stream to more callback functions 00102 #define SIID_DATASTREAMNODE 63 ///< SDataStreamNodeI - allows to split processing into two parts by saving features, segmentation and channel 00103 #define SIID_SEGMENTATION 65 ///< SSegmentationI - speech/nonspeech segmentation 00104 #define SIID_MUTEX 66 ///< SMutexI - controls mutual exclusive access 00105 #define SIID_ERRORHANDLER 67 ///< SErrorHandlerI - error handler 00106 #define SIID_TEXTMESSAGE 68 ///< STextMessageI - text message used with error handler 00107 #define SIID_WAVEFORM 69 ///< SWaveformI - a container for storing a waveform 00108 #define SIID_RANDGEN 70 ///< SRandomGeneratorI - random generator of uniformly distributed values 00109 #define SIID_DATAENCODER 73 ///< SDataEncoderI - simple data encoder 00110 #define SIID_FREQFILTER 74 ///< SFrequencyFilterI - IIR frequency filter 00111 #define SIID_F0TOSEGM 75 ///< SF0EstimateToSegmConvertorI - f0 estimate to segmentation convertor 00112 #define SIID_GMMPRESELTABLE 76 ///< SGMMPreselectionTableI - Gaussian pre-selection table for the GMM evaluation speed-up 00113 #define SIID_WAVEFORMNODE 77 ///< SWaveformNodeI - forwards waveform from the input to output 00114 #define SIID_TRANSNODE 78 ///< STranscriptionNodeI - forwards transcription from the input to output 00115 #define SIID_WAVEFORMRESEGM 79 ///< SWaveformResegmenterI - cuts off silense parts from waveform and produces new segmemtation labels 00116 #define SIID_LINTRANSFORM 80 ///< SLinearTransformI - precomputed linear transform (DCT) 00117 #define SIID_WAVEFORMPARTSEL 81 ///< SActiveWaveformPartSelectorI - selects active waveform part of given start time and length 00118 #define SIID_GMMSTATSCOLLECTOR 84 ///< SGMMStatisticCollectorI - collects different statistics using Gaussian Mixture Model 00119 #define SIID_STATISTICSNODE 85 ///< SStatisticsNodeI - forwards statistics from input to output 00120 #define SIID_IVECTOREXTRACTOR 86 ///< SIVectorExtractorI - extracts iVectors for speaker recognition 00121 #define SIID_WAVEFORMRESAMPLER 87 ///< SWaveformResamplerI - waveform resampler 00122 #define SIID_TWOCOVMODEL 88 ///< STwoCovarianceModelI - two covariance model 00123 #define SIID_VOICEPRINT 89 ///< SVoicePrintI - voice-print container for speaker identification 00124 #define SIID_PARAMNODE 90 ///< SParametersNodeI - forwards parameters from input to output 00125 #define SIID_VPRINTEXTRACTOR 91 ///< SVoicePrintExtractorI - voice-print extractor 00126 #define SIID_MULTICOREVPEXTRACTOR 135 ///< SMulticoreVoicePrintExtractorI - multicore voice-print extractor 00127 #define SIID_VPRINTCOMPARATOR 92 ///< SVoicePrintComparatorI - voice-print comparator 00128 #define SIID_VPRINTSET 125 ///< SVoicePrintSetI - voice-print set 00129 #define SIID_VPRINTUSERCALIB 127 ///< SVoicePrintUserCalibrationI - voice-print user calibration 00130 #define SIID_SCORES 93 ///< SScoresI - container with scores comming from scoring of one records against N models 00131 #define SIID_PWSCORESCALE 94 ///< SPieceWiseScoreScaleI - training/test segment length dependent calibration 00132 #define SIID_TSPWSCORESCALE 126 ///< STwoSetPieceWiseScoreScaleI - length dependent calibration working on a score matrix for two sets (training and test) 00133 #define SIID_SCOREMEMORY 95 ///< SScoreMemoryI - score memory - an object that remembers scores 00134 #define SIID_SCORETRANSFORM 96 ///< SScoreTransformI - score transformations 00135 #define SIID_SLAT2FSTCONV 97 ///< SSTKLatticeToFSTConvertorI - convertor from the STK lattice to the OpenFST finite state transducer 00136 #define SIID_SFST2CNCONV 98 ///< SFSTToConfusionNetworkConvertorI - convertor from finite state transducer to confusion network 00137 #define SIID_FEATURECHUNKER 99 ///< SFeatureChunkerI - split feature matrix into chunks 00138 #define SIID_IVCT2FMCONV 111 ///< SIVectorsToFeatureMatrixConvertorI - convert IVectors into matrix of floats (features) 00139 #define SIID_FM2IVCTCONV 112 ///< SFeatureMatrixToIVectorsConvertorI - convert matrix of floats into IVectors 00140 #define SIID_INDTOSEGM 113 ///< SIndexesToSegmConvertor - cluster of indexes to segmentation convertor 00141 #define SIID_VECTORQUANTIZER 114 ///< SVectorQuantizerI - vector quantization 00142 #define SIID_FEATURESELECTOR 120 ///< SFeatureSelectorI - feature multi class segmenter 00143 #define SIID_WAVEFORMSELECTOR 121 ///< SWaveformSelectorI - waveform multi class segmenter 00144 #define SIID_WAVEFORMJOINER 122 ///< SWaveformJoinerI - joins more waveform segments together 00145 #define SIID_GMMMODELLIST 115 ///< SGMMModelListI - an adoptor form SGMMListI to SModelListI 00146 #define SIID_SCOREMERGER 123 ///< SScoreMergerI - merges multiple scores containers into one keeping the best score for each model 00147 #define SIID_SCORENODE 117 ///< SScoresNodeI - forwards scores from input to output 00148 #define SIID_VPMODELLIST 118 ///< SVoicePrintModelListI - voice-print model list for SSignalModelling2I 00149 #define SIID_IVCT2VPCONV 119 ///< SIVectorToVoicePrintConvertorI - iVector to voice-print convertor 00150 #define SIID_DIARIZER 124 ///< SDiarizerI - speaker diarization 00151 #define SIID_NGRAMPMODELLIST 129 ///< SNGramPhonotacticModelListI - n-gram phonotactic model list 00152 #define SIID_WAVEFORMSEGONLINE 131 ///< SOnlineWaveformSegmenterI - online waveform segmenter 00153 #define SIID_FEATURESEGONLINE 132 ///< SOnlineFeatureSegmenterI - online feature segmenter 00154 #define SIID_MEANESTIM 134 ///< SMeanEstimationI - estimation of means 00155 #define SIID_OBJECTMEMORY 133 ///< SObjectMemory - allows object sharing 00156 00157 // waveform sources 00158 #define SIID_WS_AUDIO 400 ///< SAudioWaveformSourceI - waveform source - Windows or Linux audio system 00159 #define SIID_WS_FILE 401 ///< SFileWaveformSourceI - waveform source - File 00160 00161 // waveform targets 00162 #define SIID_WT_AUDIO 450 ///< SAudioWaveformTargetI - waveform target - Windows or Linux audio system 00163 #define SIID_WT_AUDIO_OSS 451 ///< SAudioWaveformTargetAlsaI - waveform target - Linux oss audio system 00164 00165 // feature extractors 00166 #define SIID_FE_MELBANKS 250 ///< SMelBanksI - feature extractor - Mel-banks 00167 #define SIID_FE_PLP 251 ///< SPLPI - feature extractor - Perceptual Linear Prediction 00168 #define SIID_FE_MFCC 252 ///< SMFCCI - feature extractor - Mel Frequency Cepstral Coefficients 00169 #define SIID_FE_F0ESTIMATOR 253 ///< SF0EstimatorI - feature extractor - fundamental frequency 00170 00171 // feature transforms 00172 #define SIID_FTR_NNPOST 8 ///< SNNetPosteriorEstimatorI - feature transform - Neural network posterior estimator (STC, TRAPS ...) 00173 #define SIID_FTR_FEACAT 9 ///< SFeaCatI - feature transform - STK SFeaCat functionality 00174 #define SIID_FTR_NORM 10 ///< SNormalizationI - feature transform - normalization 00175 #define SIID_FTR_OFFLINENORM 64 ///< SOfflineNormalizationI - feature transform - offline normalization 00176 #define SIID_FTR_STG 28 ///< SSTGI - feature transform - short time Gaussianization 00177 #define SIID_FTR_F0SMOOTHING 82 ///< SF0SmoothingI - smooths transitions between the f0 estimates and other states 00178 #define SIID_FTR_FEATURENODE 83 ///< SFeatureNodeI - forwards frames from the input to output 00179 00180 // decoders 00181 #define SIID_DE_PHN 100 ///< SPhnDecoderI - decoder - basic phoneme loop 00182 #define SIID_DE_STK 101 ///< SSTKDecoderI - decoder - STK universal decoder 00183 #define SIID_DE_KALDI 105 ///< SKaldiDecoderI - decoder - Kaldi universal decoder 00184 #define SIID_DE_KWS 102 ///< SKWSDecoderI - decoder - STK keyword spotting decoder 00185 #define SIID_DE_GMM 103 ///< SGMMDecoderI - decoder - STK GMM decoder (speaker and language recognition) 00186 #define SIID_DE_ALIGN 104 ///< SAlignerI - decoder - Phoneme aligner 00187 00188 // transcription postprocessing 00189 #define SIID_SEGMENTMAPPER 151 ///< SSegmentMapperI - segment mapper - maps segment boundaries to their original times before using VAD, waveform filter etc. 00190 #define SIID_LABELMAPPER 152 ///< SLabelMapperI - label mapper 00191 #define SIID_LABELADJUSTER 153 ///< SLabelAdjusterI - label adjuster 00192 #define SIID_CALIBRATION 154 ///< SCalibrationI - calibration 00193 #define SIID_CALIBRATION_PHN 155 ///< SPhonemeBasedCalibrationI - phoneme based calibration 00194 #define SIID_TRANSSEGMENTER 156 ///< STranscriptionSegmenterI - split transcriptions to segments 00195 #define SIID_LABELCLUSTERER 157 ///< SLabelClustererI - label clusterer 00196 #define SIID_TRANSJOINTER 158 ///< STranscriptionJointerI - Joins transcription's time 00197 #define SIID_TRANSCHSCONV 159 ///< STranscriptionCharsetConvertorI - converts charset of words in STransOneWordI container 00198 00199 // parameters 00200 #define SIID_PARAM_NORM 200 ///< SParamNormI - normalization parameters (means, variances, global variances) 00201 #define SIID_PARAM_CMLLR 201 ///< SParamCmllrI - CMLLR parameters 00202 #define SIID_PARAM_GMMESTIM 202 ///< SParamGMMEstimI - actual factor and scores counted by SGMMBasedEstimatorI 00203 #define SIID_PARAM_IVECTOR 203 ///< SParamIVectorI - iVector speaker parameters 00204 #define SIID_PARAM_INDEXCLUST 204 ///< SParamIndexClusterI - cluster of indexes - array of integers (used for diarization) 00205 00206 // statistics 00207 #define SIID_STATS_CMLLR 220 ///< SStatsCmllrI - CMLLR statistics 00208 #define SIID_STATS_GMM 221 ///< SStatsGMMI - statistics collected by GMM (zero, first, and second order statistics) 00209 00210 // transcriptions - possible recognizer outputs 00211 #define SIID_TRANS_ONEWORD 300 ///< STransOneWordI - transcription - one word 00212 #define SIID_TRANS_ONEBEST 301 ///< STransOneBestI - transcription - one best string 00213 #define SIID_TRANS_NBEST 302 ///< Not implemented - transcription - N best strings 00214 #define SIID_TRANS_LATTICE 303 ///< STransLatticeI - transcription - lattice 00215 #define SIID_TRANS_POSTERIORS 304 ///< STransPosteriorsI - transcription - posteriors - sum of posterior probabilities for each label 00216 #define SIID_TRANS_SEGMARRAY 305 ///< STransSegmentationArrayI - segmentation array 00217 #define SIID_TRANS_FST 306 ///< STransFSTI - transcription - OpenFST finite state transducer 00218 #define SIID_TRANS_FST_EXT 308 ///< STransFSTExtensionI - extension for STransFSTI 00219 00220 // keyword spotting 00221 #define SIID_KWS 310 ///< SKeywordSpottingI - keyword spotting system 00222 #define SIID_KEYWORDLIST 311 ///< SKeywordListI - list of keywords 00223 #define SIID_KEYWORD 312 ///< SKeywordI - container for one keyword in keyword list 00224 #define SIID_KWDDETFILTER 313 ///< SKeywordDetectionFilterI - filtering of overlapped detections of the same keyword (with different pronunciation) 00225 #define SIID_KWDTHRESHOLD 314 ///< SKeywordThresholdI - thresholding of keyword detections 00226 #define SIID_KWDSCORENORM 315 ///< SKeywordScoreNormI - keyword detection score normalization 00227 #define SIID_KWDDURMODEL 316 ///< SKeywordDurationModelI - keyword duration model (score normalization based on duration of a hypothesis) 00228 00229 // signal modelling modules 00230 #define SIID_SMS_ACOUSTIC 501 ///< SAcousticSMSubsystemI - acoustic signal modelling subsystem 00231 #define SIID_SMS_PHONOTACTIC 502 ///< SPhonotacticSMSubsystemI - phonotactic signal modelling subsystem 00232 00233 // models for phonotactic signal modelling 00234 #define SIID_PM_NGRAM 550 ///< SNGramPhonotacticModelsI n-gram phonotactic models 00235 00236 // factor analysis for SGMMI 00237 #define SIID_FA_EIGENCHANNELS 559 ///< SEigenChannelsFAI - eigenchannel adaptation 00238 #define SIID_FA_ESPKECHANNELS 560 ///< SEVoicesEChannelsFAI - speaker variability, remaining speaker variability and channel variability 00239 #define SIID_FC_SPEAKERCHANNEL 570 ///< SSpeakerChannelFactorsI - factor container for SEigenvoicesEigenchannelsFAI 00240 00241 // file format readers/writers 00242 #define SIID_FF_RIFFFILE 600 ///< SRiffRile - Riff file format reader and writer 00243 00244 // define audio format readers/writers 00245 #define SIID_AF_RAWFILE 650 ///< SRawFile - raw file format reader and writer 00246 #define SIID_AF_WAVEFILE 651 ///< SWaveFile - MS WAVE file format reader and writer 00247 00248 // network generators for SKWS decoder 00249 #define SIID_KWSNG_CIPHNLOOP 700 ///< SCIPhnLoopKWSNetGen - context independent network with phoneme loop in background genetated from raw word list 00250 #define SIID_KWSNG_CIPHNLOOP1 701 ///< SCIPhnLoopKWSNetGen - context independent network with phoneme loop in background generated from SKeywordListI 00251 00252 #define SIID_CMLLR_ESTIMATOR 800 ///< SCmllrEstimator - CMLLR transform 00253 00254 // XML parser 00255 #define SIID_XMLDOCUMENT 710 ///< SXMLDocument - XML document parser nad tree 00256 #define SIID_XMLNODE 711 ///< SXMLNode - XML node - one tag \<node\> \</node\> 00257 #define SIID_XMLPROPERTIES 712 ///< SXMLProperties - node properties - \<node prop1=arg1 prop2=arg2\> \</node\> 00258 00259 // dumpers 00260 #define SIID_FEATUREDUMPER 900 ///< SFeatureDumperI - dumps features to a file and sends them further 00261 #define SIID_TRANSCDUMPER 901 ///< STranscriptionDumperI - dumps transcriptions to a file and sends them further 00262 #define SIID_SCOREDUMPER 902 ///< SScoreDumperI - dumps scores to a file and sends them further 00263 00264 //targets 00265 #define SIID_FSTTARGET 910 ///< SFstTargetI - save the OpenFST finite state transducer to a file 00266 #define SIID_TRANSCRIPTIONTARGET 911 ///< STranscriptionTargetI - save the ONEWORD to a file 00267 00268 // waveform editor 00269 #define SIID_WEDITOR 1000 ///< SWaveformEditorI - class for synchronization panels 00270 #define SIID_WAVEFORMDATA 1001 ///< SWaveformDataI 00271 #define SIID_TIMEPANEL 1002 ///< SWEPTimePanelI - time axis 00272 #define SIID_LABELPANEL 1003 ///< SWEPLabelPanelI - transcription panel 00273 #define SIID_HLIGHT 1004 ///< SWaveformEditorHighlightingI - one highlighting 00274 #define SIID_HLIGHTLIST 1005 ///< SWaveformEditorHighlightingListI - list of highlighting 00275 #define SIID_WAVEFORMPANEL 1006 ///< SWEPWaveformPanelI - waveform panel 00276 #define SIID_POWERPANEL 1007 ///< SWEPPowerPanel - power panel 00277 00280 00281 // Types 00283 00284 #ifndef _BSAPI_LITE_H 00285 00286 // 64 bits integer type 00287 #ifndef long_long 00288 typedef long long long_long; 00289 #endif 00290 00291 #if((defined(_WIN32) || defined(_MSV_VER) || defined(__WATCOMC__) || defined(__BORLANDC__) || \ 00292 defined(__CINT__) || defined(__CYGWIN__) || defined(__MINGW32__)) && (!defined _WIN64)) 00293 #define BSAPI_METHOD __cdecl ///< Platform specific calling convention. 00294 #else 00295 #define BSAPI_METHOD ///< Platform specific calling convention. 00296 #endif 00297 #endif 00298 00301 typedef struct 00302 { 00303 const char *mpSection; 00304 const char *mpVariable; 00305 int mType; 00306 const char *mpDefaultValue; 00307 } config_var_type; 00308 00314 #define LICM_NOLICENSE 0 ///< GetLicense special return value 00315 // @} 00316 00322 #define CE_STRING 0 00323 #define CE_BOOL 1 00324 #define CE_INT 2 00325 #define CE_FLOAT 3 00326 // @} 00327 00333 #define WF_UNK_SAMPLEFREQ -1 00334 #define WF_UNK_NCHANNELS -1 00335 #define WF_UNK_NSAMPLES -1 00336 // @} 00337 00340 typedef struct 00341 { 00342 long_long mStart; // less than 0 for unused entry 00343 long_long mEnd; 00344 unsigned int mLabel; 00345 } segm_pos_type; 00346 00352 #define SE_UNKNOWN 0 00353 #define SE_VOICE 1 00354 #define SE_SILENCE 2 00355 #define SE_TECHNICAL 3 00356 #define SE_MUSIC 4 00357 // @} 00358 00361 typedef struct 00362 { 00363 char *mpTrans; 00364 float mProb; 00365 int mSource; 00366 } te_type; 00367 00368 class SFloatMatrixI; 00369 00373 typedef struct 00374 { 00375 SFloatMatrixI * mpMatrix; 00376 int mNFrames; 00377 unsigned int mFlags; 00378 } fea_type; 00379 00382 typedef unsigned short bsapi_wchar_t; 00383 00386 typedef struct 00387 { 00388 unsigned char red; 00389 unsigned char green; 00390 unsigned char blue; 00391 unsigned char alpha; 00392 } rgba_type; 00393 00399 #define WEP_CHANNEL_ALL -1 00400 // @} 00401 00407 #define PHNTS_UNKNOWN 0 00408 #define PHNTS_LEXICON 1 00409 #define PHNTS_G2P 2 00410 // @} 00411 00417 #define LEX_ALLPARTS 99999 ///< Used in Save, SaveText, SaveBinary 00418 // @} 00419 00425 #define PF_OFFLINEPROC 1 00426 #define PF_LASTFRAME 2 00427 #define PF_EOF 4 00428 #define PF_LASTSEGMENT 8 00429 // @} 00430 00436 #define DE_TIMEPRUNINGDISABLED 0 00437 // @} 00438 00444 #define SM_IDENTIFICATION 1 00445 #define SM_DETECTION 2 00446 // @} 00447 00453 #define GMMRF_MEANS 0x0001 ///< Means are reestimated 00454 #define GMMRF_VARIANCES 0x0002 ///< Variances are reestimated 00455 #define GMMRF_WEIGHTS 0x0004 ///< Weights are reestimated 00456 // @} 00457 00458 // GMM parts (nonexisting parts are not necessary or they are taken from Universal Background Model) 00464 #define GMMP_MEANS 0x0001 ///< Means - else UBM means are used 00465 #define GMMP_VARIANCES 0x0002 ///< Variance - else UBM variances are used 00466 #define GMMP_WEIGHTS 0x0004 ///< Weights - else UBM weights are used 00467 #define GMMP_FA 0x0008 ///< The model contain factors for model synthesis based on factor analysis (the flag is used in model file only) 00468 #define GMMP_NFRAMES 0x0010 ///< Number of frames used during training 00469 #define GMMP_XSTATS 0x0080 ///< First order statistics 00470 #define GMMP_X2STATS 0x0100 ///< Second order statistics 00471 #define GMMP_OCCSTATS 0x0200 ///< Gaussian occupation statistics 00472 #define GMMP_ZSTATS 0x0400 ///< z statistics (see Niko's SDV 2004 NIST SRE submission) 00473 #define GMMP_SENTOCCSTATS 0x0800 ///< Occupation statistics for the last sentence 00474 #define GMMP_SENTXSTATS 0x1000 ///< First order statistics for the last sentence 00475 #define GMMP_SENTX2STATS 0x2000 ///< Second order statistics for the last sentence 00476 #define GMMP_ADAPTEDMEANS 0x4000 ///< Adapted means 00477 // @} 00478 00484 #define GMMSM_PERFRAME 0x0001 ///< Classical scoring - likelihood for each frame is calculated and then the likelihoods are summed together. 00485 #define GMMSM_PERSENTENCE 0x0002 ///< Some statistics are collected and the scoring is done at the end of sentence. 00486 #define GMMSM_COLLECTZSTATS 0x0020 ///< Collect z statistics (see Niko's SDV 2004 NIST SRE submission) 00487 #define GMMSM_DUMPLIKE 0x0040 ///< Dump per bunch (number of frames sent to the instance at once) likelihood 00488 // @} 00489 00495 #define FAP_COLREESTSTATS 0x00001 ///< collect reestimation statistics 00496 #define FAP_COLSENTOCCSTATS 0x00002 ///< collect per sentence occupation statistics by all models 00497 #define FAP_COLSENTOCCSTATS_UBM 0x00004 ///< collect per sentence occupation statistics by UBM only 00498 #define FAP_COLSENTZSTATS 0x00008 ///< collect per sentence z statistics 00499 #define FAP_COLSENTZSTATS1 0x00010 ///< collect per sentence z statistics but use UBM likelihoods 00500 #define FAP_SYNTMODEL 0x00020 ///< synthetize or adapt model 00501 #define FAP_SCOREMODEL 0x00040 ///< score model 00502 #define FAP_REESTIMATE 0x00080 ///< reestimate model 00503 #define FAP_UBMONLY 0x00100 ///< go through UBM only 00504 #define FAP_MODELSONLY 0x00200 ///< go through models only 00505 #define FAP_USEORIGINALMODEL 0x00400 ///< switch to non-adapted model 00506 #define FAP_USEADAPTEDMODEL 0x00800 ///< switch to adapted model 00507 #define FAP_RESETACCUMS 0x01000 ///< reset accums at the beggining of pass 00508 #define FAP_RESETSENTACCUMS 0x02000 ///< reset per sentence accums at the beggining of pass 00509 #define FAP_EVALUATEGAUSS 0x04000 ///< evaluate Gaussians in this pass by all models 00510 #define FAP_EVALUATEGAUSS_UBM 0x08000 ///< evaluate Gaussians in this pass by UBM only 00511 #define FAP_COLSENTXSTATS 0x10000 ///< collect first order statistics 00512 #define FAP_COLSENTX2STATS 0x20000 ///< collect second order statistics 00513 // @} 00514 00521 #define LBF_TIMES 0x0001 ///< Include start and end time 00522 #define LBF_SCORE 0x0002 ///< Include score (usually likelihood) 00523 #define LBF_CONFIDENCE 0x0004 ///< Include confidence measure 00524 #define LBF_FST 0x0008 ///< Save in FST format 00525 #define LBF_CHANNEL 0x0010 ///< Include channel number 00526 // @} 00527 00533 #define XMLF_ADDHEADER 0x0001 ///< add XML version and encoding tags 00534 #define XMLF_ADDSTYLESHEET 0x0002 ///< add XML style sheet tag for XSLT 00535 // @} 00536 00542 #define TFEX_UNDEFINED 0x0001 ///< undefined flags 00543 #define TFEX_POSTERIORS 0x0002 ///< the container will have posterior probability associated to each arc 00544 #define TFEX_STARTS 0x0004 ///< the container will have start time associated to each arc 00545 #define TFEX_ENDS 0x0008 ///< the container will have end time associated to each arc 00546 #define TFEX_ALPHAS 0x0010 ///< the container will have alpha (forward) probability associated to each node 00547 #define TFEX_BETAS 0x0020 ///< the container will have beta (backward) probability associated to each node 00548 #define TFEX_LANGUAGELIKES 0x0040 ///< the container will have language model likelihoods 00549 #define TFEX_ACOUSTICLIKES 0x0080 ///< the container will have acoustic model likelihoods 00550 // @} 00551 00554 typedef float (*psoft_func_type)(float v1, float v2, float v3, float v4); 00555 00558 typedef float (*pdist_func_type)(int vectorSize, float *pVector1, float *pVector2); 00559 00561 // Error, warning and logging messages 00563 00569 #ifndef _BSAPI_LITE_H 00570 #define EMSG_OK 0 ///< Everything is all right 00571 #define EMSG_NOMEMORY 1 ///< System can not allocate memory 00572 #define EMSG_OTHER 2 ///< Other error - in case a separate code has not been associated yet 00573 #define EMSG_NOTIMPLEMENTED 3 ///< The functionality is not implemented 00574 #define EMSG_FILE 4 ///< File opening or reading error 00575 00576 #define WMSG_NOTIMPLEMENTED 9000 ///< The functionality is not implemented 00577 00578 #define LMSG_OTHER 5100 ///< Other log message 00579 #endif 00580 // @} 00581 00587 #define EMSG_LICM_OTHER 50 ///< Unknown licensing error. 00588 #define EMSG_LICM_LICEXPIRED 51 ///< License expired. 00589 #define EMSG_LICM_LICENOUGH 52 ///< Not enough free licenses. 00590 #define EMSG_LICM_LICAPP 53 ///< License is not for this application. 00591 #define EMSG_LICM_LICNOTFOUND 54 ///< License with ID '%u' was not found. 00592 #define EMSG_LICM_LICEXISTS 55 ///< License with ID '%u' already exists. 00593 #define EMSG_LICM_LICNOTRELEASED 56 ///< One or more licenses have not been released by 'ReleaseLicense'. 00594 #define EMSG_LICM_OPEN 60 ///< License file is missing. 00595 #define EMSG_LICM_HTTPCOMM 61 ///< Network communication error during license negotiation. 00596 #define EMSG_LICM_NOTOKEN 62 ///< No USB token found during license negotiation. 00597 #define EMSG_LICM_PARSE_HW 63 ///< License parsing error. Hardware configuration has probably been changed. 00598 #define LMSG_LICM_LICSTATUS 70 ///< License status. 00599 00600 00606 #define EMSG_CFG_UNKNOWNVAR 100 ///< Unknown configuration variable 00607 #define EMSG_CFG_INVALIDARG 101 ///< Invalid argument type of configuration variable (string instead float etc.) 00608 #define EMSG_CFG_FILE 102 ///< Can not open or read configuration file 00609 #define EMSG_CFG_INVALIDNOT 103 ///< Invalid notation of configuration variable (should be 'variable=argument') 00610 00611 00617 #define EMSG_LEX_IFILE 200 ///< Can not open lexicon file 00618 #define EMSG_LEX_OFILE 201 ///< Can not create lexicon file 00619 #define EMSG_LEX_SYNTAX 202 ///< Invalid syntax of lexicon entry, should be 'word phn1 phn2 ...' 00620 #define EMSG_LEX_INVFNAME 203 ///< Invalid file name format '%s'. Should be 'file_name,part,format[ascii,binary]'. 00621 00622 00628 #define EMSG_PHNT_PHNFILE 205 ///< Can not open phoneme file '%s'. 00629 #define EMSG_PHNT_CHARFILE 206 ///< Can not open character file '%s'. 00630 00631 00637 #define EMSG_NETG_IFILE 210 ///< Can not open input file '%s'. 00638 #define EMSG_NETG_IFILER 211 ///< Can not read input file '%s'. 00639 #define EMSG_NETG_PHNFILE 212 ///< Can not open phoneme file '%s'. 00640 #define ENSG_NETG_NOPHNLIST 213 ///< The phoneme list must be loaded before network generating. 00641 #define EMSG_NETG_NOPHNTRANS 214 ///< The PhnTrans must be set before network generating. 00642 #define EMSG_NETG_NOKWDLIST 215 ///< The keyword list must be set before networks generating. 00643 #define EMSG_NETG_UNKTRANS 216 ///< Word '%s' does not have pronunciation variant. 00644 #define EMSG_NETG_OFILE 217 ///< Can not create output network file '%s'. 00645 #define ENSG_NETG_NOWORDS 218 ///< The keyword list does not contain valid and enabled words. 00646 00647 00653 #define EMSG_G2P_IFILE 300 ///< Can not open symbols or rules 00654 #define EMSG_G2P_UNKGRAPHEME 301 ///< Unknown grapheme 00655 00656 00662 #define EMSG_OBJMEM_INVALIDARG 322 ///< Key name or object pointer invalid 00663 #define EMSG_OBJMEM_OBJLEFT 325 ///< Some objects weren t removed from the objmem before destroying it 00664 #define EMSG_OBJMEM_NOTFOUND 326 ///< Item 's' not found. 00665 #define EMSG_OBJMEM_ALREADYADDED 327 ///< The object was already added to the memory 00666 #define EMSG_OBJMEM_ADDFAILED 328 ///< Cannot add an object to the object memory 00667 #define EMSG_OBJMEM_LOCKADDFAILED 329 ///< Cannot add a lock to the lock map 00668 #define EMSG_OBJMEM_ALREADYCREATED 331 ///< The item '%s' has already been created 00669 #define EMSG_OBJMEM_CREATEFAILED 332 ///< Cannot add an object item to the object memory 00670 #define EMSG_OBJMEM_NOTADDED 333 ///< No object has been added to item '%s' yet. 00671 00672 00678 #define EMSG_TRANS_IFILE 400 ///< Can not open transcription file 00679 #define EMSG_TRANS_OFILE 401 ///< Can not create transcription file 00680 #define EMSG_TRANS_INVALIDFMT 402 ///< Invalid file format 00681 #define EMSG_TRANS_ASSIGN 403 ///< Assign failed 00682 #define EMSG_TRANS_UNSUPFSTTYPE 404 ///< Unsupported FST type '%s'. The supported type is 'vector'. 00683 #define EMSG_TRANS_UNSUPCONT1 405 ///< Only the STransFST transcription container can be assigned to the STransFST container. 00684 #define EMSG_TRANS_NOARRAY 406 ///< One of arrays in the FST extension (GetStarts, GetEnds, GetAlphas, GetBetas, GetPosteriors, GetLanguageLikes, GetAcousticLikes) is not available. Check initialization flags. 00685 #define EMSG_TRANS_UNKFLAG 407 ///< Unknown flag '%s' for FST extension container. 00686 00687 00693 #define EMSG_DE_UNSUPPORTEDINT 601 ///< Request for unsupported transcription interface 00694 #define EMSG_DE_LOADHMM 602 ///< Can not load HMM set 00695 #define EMSG_DE_LOADNET 603 ///< Can not load recognition network 00696 #define EMSG_DE_NETNOTSET 604 ///< Recognition started but the recognition network was not loaded 00697 #define EMSG_DE_HMMNOTSET 605 ///< Recognition started but the HMM was not set 00698 #define EMSG_DE_WRONGNETFMT 606 ///< Wrong network format 00699 #define WMSG_DE_OVERPRUNING 650 ///< Overpruning or bad data. Empty transcription sent. 00700 00701 00707 #define EMSG_KADE_UNSUPPORTEDINT 611 ///< Request for unsupported transcription interface 00708 #define EMSG_KADE_LOADHMM 612 ///< Can not load HMM set 00709 #define EMSG_KADE_LOADNET 613 ///< Can not load recognition network 00710 #define EMSG_KADE_NETNOTSET 614 ///< Recognition started but the recognition network was not loaded 00711 #define EMSG_KADE_HMMNOTSET 615 ///< Recognition started but the HMM was not set 00712 #define WMSG_KADE_OVERPRUNING 660 ///< Overpruning or bad data. Empty transcription sent. 00713 00714 00720 #define EMSG_SREC_NOG2PSYMBOLS 800 ///< File of G2P rules specified but file of G2P symbols not 00721 #define EMSG_SREC_UNKTRANSINT 801 ///< Unknown transcription interface for decoder output 00722 #define EMSG_SREC_UNKDECODER 802 ///< Unknown decoder interface 00723 #define EMSG_SREC_SAVELAB 803 ///< Can not create label file 00724 #define EMSG_SREC_SAVEMLF 804 ///< Can not create MLF file 00725 #define EMSG_SREC_UNKFEINT 805 ///< Unknown feature extraction interface 00726 #define EMSG_SREC_UNKIFMT 806 ///< Unknown input format 00727 #define EMSG_SREC_UNKOFMT 807 ///< Unknown output format 00728 #define EMSG_SREC_UNINITMODULE 808 ///< Uninitialized module 00729 #define EMSG_SREC_UNSUPCONV 809 ///< Unsupported data format conversion 00730 #define EMSG_SREC_SOFTFUNC 810 ///< Unknown softening function of wrong notation 00731 #define EMSG_SREC_UNSUPIFMT 811 ///< Unsupported input format 00732 #define EMSG_SREC_UNSUPOFMT 812 ///< Unsupported output format 00733 #define EMSG_SREC_LOADLIST 813 ///< Can not open file list, allocate memory or load the data 00734 #define EMSG_SREC_INVALIDLINE 815 ///< Invalid line in file list 00735 #define EMSG_SREC_UNKFEATURETR 816 ///< Unknown feature transform interface 00736 #define EMSG_SREC_INVALIDOUTPUT 817 ///< Output matrix can not be specified if the output is hypothesis 00737 #define EMSG_SREC_INVSELECTION 818 ///< Invalid selection file[from,to] 00738 00739 00745 #define EMSG_BS_BLOCKNOTFOUND 850 ///< Block '%s' was not found (not configured) 00746 #define EMSG_BS_CANNOTLINKBLOCKS 851 ///< Block '%s' can not be linked to block '%s' 00747 #define EMSG_BS_CANNOTCREATBLOCK 852 ///< Block of type '%s' can not be instantiated 00748 #define EMSG_BS_CANNOTSETSOURCE 853 ///< Block '%s' can not be set as a source for block '%s' 00749 #define EMSG_BS_INVALIDLINKFMT 854 ///< Invalid argument format of configuration variable 'links/%s' in file '%s' 00750 #define LMSG_BS_INITSTART 855 ///< System initialization 00751 #define LMSG_BS_INITDONE 856 ///< System initialization done 00752 #define LMSG_BS_INITBLOCK 857 ///< 'block name' 00753 #define LMSG_BS_BLOCKVARS 858 ///< 'variable' = 'value' 00754 00755 00761 #define EMSG_WS_EMPTYINPUTLINE 900 ///< Empty input line (SFileWaveformSource only) 00762 #define EMSG_WS_WRONGILFORMAT 901 ///< Wrong format of input line, should be file[start,stop] (SFileWaveformSource only) 00763 #define EMSG_WS_IFILE 902 ///< Can not open input file (SFileWaveformSource only) 00764 #define EMSG_WS_UNSUPFILEFORMAT 903 ///< Unsupported file format (SFileWaveformSource only) 00765 #define EMSG_WS_CANNOTOPENEVICE 904 ///< Can not open sound device 00766 #define EMSG_WS_NOTOPEN 905 ///< The device is not open - the Read function used without Open 00767 #define EMSG_WS_ALREADYOPEN 906 ///< The device is already open - the Open or Start function is called twice 00768 #define EMSG_WS_OTHER 907 ///< Error in waveInPrepareHeader or waveInAddBuffer or waveInStart MMSYSTEM function 00769 #define EMSG_WS_CREATETHREAD 908 ///< Can not create second thread 00770 #define EMSG_WS_UNSUPSETTING 909 ///< Unsupported setting 00771 00772 00778 #define EMSG_WT_CANNOTOPENEVICE 925 ///< Can not open sound device 00779 #define EMSG_WT_NOTOPEN 926 ///< The device is not open - the Write function used without Open 00780 #define EMSG_WT_ALREADYOPEN 927 ///< The device is already open - the Open function is called twice 00781 #define EMSG_WT_OTHER 928 ///< Error in waveOutPrepareHeader or waveOutWrite MMSYSTEM function 00782 #define EMSG_WT_UNSUPPORTEDFMT 929 ///< Unsupported waveform format, should be 'lin16' 00783 #define WMSG_WT_WRONGWFSIZE 940 ///< Wrong waveform size, should be divisible by size of short 00784 00785 00791 #define EMSG_WM_UNSUPFORMAT 950 ///< Unsupported input format. Only the 'float' format is supported. 00792 00793 00799 #define EMSG_WRES_UNSUPFORMAT 960 ///< Unsupported input format. Only the 'float' format is supported. 00800 #define EMSG_WRES_UNKSSAMPLFREQ 961 ///< Unknown source sampling frequency. 00801 #define EMSG_WRES_UNSUPPORTEDNCHN 962 ///< Unsupported number of waveform channels, should be one channel waveform. 00802 #define EMSG_WRES_UNKTSAMPLFREQ 963 ///< Unknown target sampling frequency. 00803 00804 00810 #define EMSG_WSGM_NOFULLWAVEFORM 975 ///< Online processing is not supported, waveform must have PF_OFFLINEPROC flag. 00811 #define EMSG_WSGM_UNSUPFORMAT 976 ///< Unsupported input format. Must be one channel 'float' vector with known sampling frequency. 00812 #define EMSG_WSGM_UNKCONTCAME 977 ///< Unknown transcription container sent to the 'OnTranscription' function. 00813 #define EMSG_WSGM_SOUTOFRANGE 978 ///< Requested segment (%d, %d) is out of waveform range (0, %d). 00814 00815 00821 #define EMSG_WSE_NOFULLWAVEFORM 985 ///< Online processing is not supported, waveform must have PF_OFFLINEPROC flag. 00822 #define EMSG_WSE_UNSUPFORMAT 986 ///< Unsupported input format. Must be one channel 'float' vector with known sampling frequency. 00823 #define EMSG_WSE_NOWAVEFORM 987 ///< The waveform must be sent to the waveform selector before transcription. 00824 #define EMSG_WSE_UNKCONTCAME 988 ///< Unknown transcription container sent to the 'OnTranscription' function. 00825 00826 00832 #define EMSG_WJOIN_UNSUPFORMAT 989 ///< Unsupported input format. Must be one channel 'float' vector with known sampling frequency. 00833 #define EMSG_WJOIN_BADSMPLFREQ 999 ///< Sampling frequency '%d' does not match previous sampling frequency '%d'. 00834 00835 00841 #define EMSG_WRS_UNKSAMPLEFREQ 980 ///< The sampling frequency must be known. 00842 #define EMSG_WRS_UNSUPTRCONT 981 ///< The '%d' transcription container is not supported, use the TRANS_ONE_WORD container. 00843 #define EMSG_WRS_UNSUPWFFORMAT 982 ///< Unsupported waveform format '%s'. 00844 #define EMSG_WRS_UNKSAMPLFREQ 983 ///< Unknown sampling frequency. 00845 00846 00852 #define EMSG_AWPS_SELINPARTREC 990 ///< Active waveform part selection can not be used for partial records. 00853 #define EMSG_AWPS_UNSUPWFFORMAT 991 ///< Unsupported waveform format '%s'. 00854 #define EMSG_AWPS_UNKSAMPLFREQ 992 ///< Unknown sampling frequency. 00855 #define EMSG_AWPS_UNSUPTRCONT 993 ///< The '%d' transcription container is not supported, use the TRANS_ONE_WORD container. 00856 00857 00863 #define EMSG_FTR_PFILE 1000 ///< Can not load parameter files 00864 #define EMSG_FTR_UNKNOWNSYSTEM 1001 ///< Unknown neural network posterior estimation system (SNNetPosteriorEstimatorI) 00865 #define EMSG_FTR_NOFULLMATRIX 1002 ///< The offline processing was enabled, but matrix without PF_LASTFRAME flag was received 00866 #define EMSG_FTR_INVALIDDIM 1003 ///< Invalid dimensionality of input features 00867 #define EMSG_FTR_TOOFEWFRAMES 1004 ///< Too few frames for offline processing, should be at least 'TrapLen' (SNNetPosteriorEstimatorI) 00868 #define EMSG_FTR_XMLPARSING 1005 ///< Can not load, write or parse XML file (SNormalization) 00869 #define EMSG_FTR_LOADTRANSFORM 1007 ///< Can not load transform 00870 #define EMSG_FTR_NOTRANSFORM 1008 ///< Transformation was not found in file (SFeaCat) 00871 #define EMSG_FTR_NOOFFLINEMAT 1009 ///< The offline processing was enabled, but a feature matrix without the PF_LASTFRAME flag was recieved 00872 #define EMSG_FTR_INVCALLORDER 1010 ///< Function 'SetOutBatchSize' must be called before 'Load' 00873 #define EMSG_FTR_MENOTSET 1011 ///< Mel-banks interface was not set. Call 'SetMelBanksInterface' function at first 00874 #define EMSG_FTR_INVTRDIM 1012 ///< Invalid transform dimensions, file %s, is %d x %d (inputs, outputs), should be %d x %d. 00875 #define EMSG_FTR_INVWINDIM 1013 ///< Invalid window dimension, file '%s', is (%d x %d), should be (1 x %d). 00876 #define EMSG_FTR_UNKCONTCAME 1014 ///< Unknown parameters container sent to the 'OnParameters' function. 00877 #define LMSG_FTR_DEBUG 1015 ///< "Numerical debug output" 00878 #define EMSG_FTR_INVALIDSOURCE 1016 ///< Feature matrix received from unknown source. Check if Source1 and Source2 were set. 00879 #define EMSG_FTR_STILLTOSENT 1017 ///< Last feature matrix arrived, but there are still %d matrices to be pasted. 00880 00881 00887 #define EMSG_NORM_UNKCONTCAME 1020 ///< Unknown transcription container sent to the 'OnTranscription' function 00888 #define EMSG_NORM_SEGMNOTSET 1021 ///< Segmentation came but usage of it is not set by 'SetUseSegmentation' function 00889 #define EMSG_NORM_WRONGUSAGE 1022 ///< Sentence based normalization, online adaptation and start/end estimation are mutually exclusive 00890 #define EMSG_NORM_INVDIM1 1023 ///< Invalid dimension of the mean/variance/global variance vector for channel %d, file '%s'. Is %d and should be %d. 00891 #define EMSG_NORM_INVDIM2 1024 ///< Invalid dimension (%d) of feature vector, should be %d. 00892 #define EMSG_NORM_INVPARAMS 1025 ///< Invalid online normalization parameters 00893 00894 00900 #define EMSG_FE_MEINIT 1100 ///< Can not initialize mel-banks. Wrong parameters or memory allocation error. 00901 #define EMSG_FE_UNSUPPORTEDFMT 1101 ///< Unsupported waveform format, should be array of flats 00902 #define EMSG_FE_NOOFFLINESIG1 1102 ///< The offline processing was enabled, but a waveform without the PF_LASTFRAME flag was recieved 00903 #define EMSG_FE_UNSUPPORTEDNCHN 1103 ///< Unsupported number of waveform channels, should be one channel waveform 00904 #define EMSG_FE_INVF0OUTSTR 1104 ///< Invalid f0 output format string flags. The supported flags are 'f h(n) x(n) m a s t(n) B(n) u'. 00905 #define EMSG_FE_TOOLONGF0OUTSTR 1105 ///< Too long feature definition string '%s'. 00906 #define EMSG_FE_MISSINGDEFFLAG 1106 ///< The minimal feature set for the f0 smoothing is: 'frlL'. 00907 #define EMSG_FE_NOOFFLINESIG2 1107 ///< Waiting for warping factor is allowed for the offline processing only. 00908 #define EMSG_FE_FFTINITERR 1108 ///< FFT initialization error. 00909 #define EMSG_FE_UNKCONTCAME 1109 ///< Unknown parameters container sent to the 'OnParameters' function 00910 #define EMSG_FE_UNSUPPORTEDSFRQ 1110 ///< Unsupported sampling frequency '%d', should be 8000 Hz. 00911 #define EMSG_FE_WRONGCONTEXT 1111 ///< Wrong interval for ranknormalization. 00912 00913 00919 #define EMSG_LT_UNKMATFORMAT 1120 ///< Unknown matrix file format '%s'. Call 'SetMatrixFormatStr' with 'ascii', 'htk' or 'binary'. 00920 #define EMSG_LT_WRONGVCTSIZE 1121 ///< Wrong input vector size '%d', should be '%d'. 00921 #define EMSG_LT_UNKCONTAINER 1122 ///< Unknown parameter container '%d' came to the 'OnParameters' function. 00922 00923 00929 #define EMSG_EREST_UNKUDMASK 1201 ///< Unknown update mask flag - function SetUpdateMask - supported letters are 'tmvwsx' 00930 #define EMSG_EREST_UNKUDTYPE 1202 ///< Unknown update type - function SetUpdateType 00931 #define EMSG_EREST_MFILEOPEN 1203 ///< Can not open model file 00932 #define EMSG_EREST_LISTFOPEN 1204 ///< Can not open model list 00933 #define EMSG_EREST_INVFEASTR 1205 ///< Single pass re-estimation requires even number (two sets) of feature streams 00934 #define EMSG_EREST_UNSUPFEA 1206 ///< Two accumulator set MMI update is not supported by BSAPI 00935 #define EMSG_EREST_DICTOPEN 1207 ///< Can not open dictionary file 00936 #define EMSG_EREST_UNKACCTYPE 1208 ///< Unknown accumulator type - function SetAccumType 00937 #define EMSG_EREST_UNKTRANSCFMT 1209 ///< Unknown transcription format - function SetInTranscFmt 00938 #define EMSG_EREST_UNKUDMODE 1210 ///< Unknown update mode - function SetUpdateMode 00939 #define EMSG_EREST_XFORMOPEN 1211 ///< Can not open xform list 00940 #define EMSG_EREST_NETOPEN 1212 ///< Can not open network file 00941 #define EMSG_EREST_MLFOPEN 1213 ///< Can not open MLF 00942 #define EMSG_EREST_INVVCTDIM 1214 ///< Vector size is incompatible with model 00943 #define EMSG_EREST_STRMISMATCH 1215 ///< Mismatch in number of frames in single pass re-estimation 00944 #define EMSG_EREST_INVFLOORMAC 1216 ///< Invalid size of variance floor vector 00945 #define EMSG_EREST_SAVEMODEL 1217 ///< Can not save model 00946 #define EMSG_EREST_STATSLABEL 1218 ///< Label does not exist 00947 00948 #define WMSG_EREST_NOTUPDATED 7000 ///< Statistic are estimated for Xform not being a single linear Xform on the input of a mixture. Means and variances will not be updated. 00949 #define WMSG_EREST_TOOFEWFRAMES 7001 ///< Number of frames is smaller than model delay, skipping segment 00950 #define WMSG_EREST_OVERPRUNING 7002 ///< Overpruning or bad data, skipping segment 00951 #define WMSG_EREST_PRUNCHANGED 7003 ///< Overpruning or bad data, trying other pruning threshold 00952 00953 00959 #define EMSG_WFCONV_UNKINFMT 1300 ///< Unknown input format 00960 #define EMSG_WFCONV_UNKOUTFMT 1301 ///< Unknown output waveform format '%s' 00961 #define EMSG_WFCONV_UNSUPOUTFMT 1302 ///< Unsupported output waveform format '%s' 00962 00963 00969 #define EMSG_CS_UNSUPPORTEDFMT 1350 ///< Unsupported waveform format, should be array of floats. 00970 #define EMSG_CS_NEGATIVECHANNEL 1351 ///< Target for channel '%d' could not be set. Channel must be a positive integer. 00971 #define WMSG_CS_WRONGWFSIZE 1375 ///< Wrong waveform size, should be divisible by size of float. 00972 00973 00978 #define EMSG_FA_INVUVDIM 1380 ///< Number of columns in eigenvoice matrix (%d) and eigenchannel matrix (%d) do not match. 00979 #define EMSG_FA_INVSVDIM 1381 ///< Number of columns in eigenvoice matrix (%d) does not match feature vector size (%d) times number of mixtures (%d) 00980 #define EMSG_FA_ESPKMISMATCH 1282 ///< Mismatch in dimension of speaker factors between model (%d) and eigen-speaker matrix (%d) 00981 00982 00988 #define EMSG_FMS_FUNCNOTSET 1400 ///< Function was not set 00989 #define LMSG_PROGRESS 5001 ///< Minimization progress 00990 00991 00997 #define EMSG_FL_LOADLIST 1500 ///< Can not load list (can not open file, allocate memory or read data) 00998 #define EMSG_FL_MISSINGSOURCE 1501 ///< Source file is missing 00999 #define LMSG_FL_LINE 5050 ///< File list line 01000 01001 01007 #define EMSG_SM_UNKSUBSYS 1550 ///< "Unknown subsystem requested in the configuration file" 01008 #define EMSG_SM_NOTINIT 1551 ///< "The signal modelling is not initialized. The 'Init' function was not called or it end up in an error state." 01009 #define EMSG_SM_BADWEIGHTS 1552 ///< "Invalid weights in configuration file." 01010 #define EMSG_SM_NOSUBSYS 1553 ///< "None of signal modelling subsystems is configured. Can not get model scores." 01011 #define EMSG_SM_UNCONSISTMOD 1554 ///< "Models from different subsystems are not consistent. Please verify model directories and run the software again." 01012 #define EMSG_SM_CANNOTMKDIR 1555 ///< "Can not create model directory." 01013 #define EMSG_SM_CANNOTRESTMOD 1556 ///< "Error during training occurred and the model set can not be restored from a backup." 01014 #define EMSG_SM_CANNOTACTPREVM 1557 ///< "Error during training occurred and the previous model set can not be activated." 01015 #define EMSG_SM_CANNOTRMTMOD 1558 ///< "Error during training occurred and the unfinished models can not be removed." 01016 #define EMSG_SM_CANNOTCRNAMEF 1559 ///< "Can not create name file '%s' for model '%s'. The model will not be used in next program run." 01017 #define EMSG_SM_CANNOTRMNAMEF 1560 ///< "Can not remove model name file '%s'. The model set will not be necessary consistent." 01018 #define EMSG_SM_CANNOTRENNAMEF 1561 ///< "Can not rename name file '%s' to '%s'. The model set will not be necessary consistent." 01019 #define EMSG_SM_CANNOTLOADTFILE 1562 ///< "Can not load training file '%s' to memory." 01020 #define EMSG_SM_INVTRAINLISTFMT 1563 ///< "Invalid format of training list. It should have two columns - model_name and speech_file_name." 01021 #define EMSG_SM_CANNOTLOADTLIST 1564 ///< "Can not load training list '%s' to memory." 01022 #define EMSG_SM_UNKSCORETRANSF 1565 ///< "Unknown score transform '%s', supported transforms are: Raw, LogLike2PostProb, LogLike2LogPostProb, LogLikeBg2PostProb, LogLikeBg2LogPostProb, LogLike2LLR, LogLikeBg2LLR, LogLike2LLRBg, LLR2PostProb, LLR2LogPostProb." 01023 #define EMSG_SM_UNKOCDETMETHOD 1566 ///< "Unknown detection method of other class." 01024 #define EMSG_SM_NOWFFILTEREN 1567 ///< "Request to use waveform filter but the filter was not enabled and configured." 01025 #define EMSG_SM_TWOSTGPROCOFPR 1568 ///< "Two stage processing of partial records is not allowed." 01026 #define EMSG_SM_NODATATORUNSS 1569 ///< "No data in memory to run second stage." 01027 #define EMSG_SM_NODATAFORTRAIN 1570 ///< "No model was stored because no data for training were available." 01028 #define EMSG_SM_NOMODELS 1571 ///< "No models are loaded. Train or activate some models first." 01029 #define WMSG_SM_ITERSTEXCEEDED 8150 ///< "Number of requested training iterations exceeded. It does not have sense to process the data again." 01030 #define LMSG_SM_INITSTART 5055 ///< "Signal modelling initialization." 01031 #define LMSG_SM_INITSUBSYS 5056 ///< "Initializing subsystem '%s', derived from '%s', config '%s'" 01032 #define LMSG_SM_INITDONE 5057 ///< "Signal modelling initialization done." 01033 #define LMSG_SM_ADDFILE 5058 ///< "Processing file '%s'." 01034 #define LMSG_SM_SEGMLOAD 5060 ///< "Loading segmentation from file '%s'." 01035 01036 01042 #define EMSG_SPKID_NOTINIT 1900 ///< "The signal modelling is not initialized. The 'Init' function was not called or it end up in an error state." 01043 #define EMSG_SPKID_DEPSYSNOTFND 1901 ///< "Dependent system '%s' was not found. Possibly not configured." 01044 #define EMSG_SPKID_UNINITWFCONV 1902 ///< "The waveform format convertor module was not initialized. Possibly not enabled in config file." 01045 01046 01052 #define EMSG_PSM_NOTINIT 1575 ///< The phonotactic signal modelling subsystem is not initialized. The 'Init' function was not called or it end up in an error state. 01053 #define EMSG_PSM_UNKMODELINT 1576 ///< Unknown interface to phonotactic models '%s' (config file '%s', variable '[models]/interface') 01054 #define EMSG_PSM_INVACTPARTSEL 1577 ///< Invalid active waveform part selection. 01055 #define EMSG_PSM_SELINPARTREC 1578 ///< Active waveform part selection can not be used for partial records 01056 #define EMSG_PSM_TOOMANYITERS 1579 ///< Exceeded number of requested training iterations. 01057 #define EMSG_PSM_UNKSAMPLFREQ 1580 ///< Unknown sampling frequency. 01058 #define EMSG_PSM_NOTRAINING 1581 ///< The 'StartTraining' function must be called at first. 01059 01060 01066 #define EMSG_ASM_NOTINIT 1700 ///< The acoustic signal modelling subsystem is not initialized. The 'Init' function was not called or it end up in an error state. 01067 #define EMSG_ASM_UNINITDECODER 1701 ///< The decoder module was not initialized. 01068 #define EMSG_ASM_UNINITWFCONV 1703 ///< The waveform format convertor module was not initialized. 01069 #define EMSG_ASM_CANNOTSELAPART 1704 ///< Can not select active waveform part. Block '%s' was not configured. 01070 #define EMSG_ASM_TOOMANYITERS 1706 ///< Exceeded number of requested training iterations. 01071 #define EMSG_ASM_CANNOTRMMODEL 1707 ///< Can not remove model '%s'. Model file '%s' can not be removed from a drive. / Model does not exist. 01072 #define EMSG_ASM_CANNORRENMOD1 1708 ///< Can not rename model '%s' to '%s'. The target model already exists. 01073 #define EMSG_ASM_CANNORRENMOD2 1709 ///< Can not rename model '%s' to '%s'. The source model does not exist. 01074 #define EMSG_ASM_CANNORRENMOD3 1710 ///< Can not rename model '%s' to '%s' because corresponding files '%s' and '%s' can not be renamed." 01075 #define EMSG_ASM_UNKSCORETRANSF 1711 ///< Unknown score transform '%s', supported transforms are: Raw, LogLike2PostProb, LogLike2LogPostProb, LogLikeBg2PostProb, LogLikeBg2LogPostProb, LogLike2LLR, LogLikeBg2LLR, LogLike2LLRBg, LLR2PostProb, LLR2LogPostProb. 01076 #define EMSG_ASM_CANNOTRMBAK 1712 ///< Can not remove old backup file '%s'. 01077 #define EMSG_ASM_CANCREATEBAK 1713 ///< Can not create a backup copy '%s' of file '%s'. 01078 #define EMSG_ASM_INCONSISTMOD1 1714 ///< Can not rename '%s' to '%s'. The model files will not be consistent. Please use a backup copy of model files. 01079 #define EMSG_ASM_CANNOTRMMOD 1715 ///< Can not remove model file '%s'. 01080 #define EMSG_ASM_INCONSISTMOD2 1716 ///< Can not restore '%s' to '%s'. The model files will not be consistent. Please use a backup copy of model files 01081 #define EMSG_ASM_UNKNOWNFA 1717 ///< Unknown factor analysis identification constant or interface identification string '%s'. 01082 #define EMSG_ASM_NOTRAINING 1718 ///< The 'StartTraining' function must be called at first. 01083 01084 #define LMSG_ASM_INITVTLN 5070 ///< VTLN initialization, config '%s'. 01085 #define LMSG_ASM_INITPARAM 5071 ///< Parameterization initialization, config '%s'. 01086 #define LMSG_ASM_INITFA 5072 ///< Factor analysis initialization, id '%s', config '%s'. 01087 01088 01094 #define EMSG_NGPM_INVTRANSCONT 1600 ///< Invalid transcription container came to input (OnTranscription function). The supported containers are 'STransOneBest' and 'STransPosteriors'. 01095 #define EMSG_NGPM_CANNOTRMMODEL 1601 ///< Can not remove model '%s'. Model file '%s' can not be removed from a drive. / Model does not exist. 01096 #define EMSG_NGPM_CANNORRENMOD1 1602 ///< Can not rename model '%s' to '%s'. The target model already exists. 01097 #define EMSG_NGPM_CANNORRENMOD2 1603 ///< Can not rename model '%s' to '%s'. The source model does not exist. 01098 #define EMSG_NGPM_CANNORRENMOD3 1604 ///< Can not rename model '%s' to '%s' because corresponding files '%s' and '%s' can not be renamed." 01099 #define EMSG_NGPM_UNKSCORETRANSF 1605 ///< Unknown score transform '%s', supported transforms are: Raw, LogLike2PostProb, LogLike2LogPostProb, LogLikeBg2PostProb, LogLikeBg2LogPostProb, LogLike2LLR, LogLikeBg2LLR, LogLike2LLRBg, LLR2PostProb, LLR2LogPostProb. 01100 #define EMSG_NGPM_CANNOTRMBAK 1606 ///< Can not remove old backup file '%s'. 01101 #define EMSG_NGPM_CANCREATEBAK 1607 ///< Can not create a backup copy '%s' of file '%s'. 01102 #define EMSG_NGPM_INCONSISTMOD1 1608 ///< Can not rename '%s' to '%s'. The model files will not be consistent. Please use a backup copy of model files. 01103 #define EMSG_NGPM_CANNOTRMMOD 1609 ///< Can not remove model file '%s'. 01104 #define EMSG_NGPM_INCONSISTMOD2 1610 ///< Can not restore '%s' to '%s'. The model files will not be consistent. Please use a backup copy of model files. 01105 #define EMSG_NGPM_CANNOTSAVEMTAB 1611 ///< Can not save label to integer mapping table 01106 #define EMSG_NGPM_WRONGFILEFMT 1650 ///< Wrong format of input model file. 01107 #define EMSG_NGPM_UNSUPFILEVER 1651 ///< Model file format version is %d but only versions up to %d are supported. 01108 #define EMSG_NGPM_NOSENTSTARTED 1651 ///< The StartSentence function must be called before the LoadTemporalFile function. 01109 01110 #define WMSG_NGPM_NOMAPFILE 8101 ///< Phoneme label to integer mapping file '%s' does not exist. 01111 #define WMSG_NGPM_CANNOTRMFILE 8102 ///< Updated model '%s' will not be used in next program run because old model file '%s' can not be removed. 01112 #define WMSG_NGPM_NOTSIGRESULT 8103 ///< There are too few ngrams for scoring in phonotactic modelling (%5.0f). The result will not be significant. 01113 01114 #define LMSG_NGPM_NFILESINTDIR 5060 ///< Found %d files with extension '%s'. 01115 #define LMSG_NGPM_SAVINGACCUMS 5061 ///< Saving Accumulators '%s'. 01116 #define LMSG_NGPM_LOADPRLM 5062 ///< Can not load PRLM models (counts). 01117 01118 01120 01126 #define EMSG_RIFF_NOLIST 1700 ///< There is not a list on the actual position in file '%s'. 01127 #define EMSG_RIFF_CREATE 1701 ///< Can not create or open file '%s'. 01128 #define EMSG_RIFF_OPEN 1702 ///< Can not open file '%s'. 01129 #define EMSG_RIFF_NOOPEN 1703 ///< No file is open. The 'Open' function must be called before using other functions. 01130 #define EMSG_RIFF_NODATA 1704 ///< Request to read more bytes (%ui) from file '%s', chunk '%s' than number of bytes in chunk (%ui). 01131 #define EMSG_RIFF_NOHEADER 1705 ///< File '%s' does not have the RIFF header 01132 #define EMSG_RIFF_NOOPENLIST 1706 ///< Can not close list. There is no more list open in RIFF file '%s' 01133 #define EMSG_RIFF_FORMATERR 1707 ///< Corrupted format of the RIFF file '%s' or read error. 01134 #define LMSG_RIFF_STRUCT 5150 ///< Format tag, chunk tags, chunk sizes, list names 01135 01136 01144 #define EMSG_WAVE_BADFORMAT 1750 ///< File '%s' is not WAVE format file. 01145 #define EMSG_WAVE_INVFORMAT 1751 ///< Corrupted WAVE file format: '%s'. 01146 #define EMSG_WAVE_NOFACT 1752 ///< Compressed WAVE file '%s' and the 'fact' chunk is missing. 01147 #define LMSG_WAVE_FORMAT 5170 ///< Dump of the 'fmt ' chunk in WAVE file 01148 01149 01155 #define EMSG_RAW_NOOPEN 1800 ///< No file is open. The 'Open' function must be called before using other functions. 01156 #define EMSG_RAW_OPEN 1801 ///< Can not open raw file '%s'. 01157 #define EMSG_RAW_READ 1802 ///< Can not read raw file '%s'. Possibly the 'Open' function was not called in read mode. 01158 #define EMSG_RAW_WRITE 1803 ///< Can not write raw file '%s'. Possibly the 'Open' function was not called in write mode. 01159 #define EMSG_RAW_GETDATALEN 1804 ///< Can not get data length of raw file '%s'. 01160 01161 01162 // other errors EMSG_FSNIF_OPENDIR, EMSG_NOMEMORY 01163 01169 #define EMSG_GMM_NOTINIT 1800 ///< The GMM is not initialized. Neither 'Load' nor 'Assign' function was called or it ended up in an error state. 01170 #define EMSG_GMM_UNSUPFILEVER 1801 ///< Model file format version is %d but only versions up to %d are supported. 01171 #define EMSG_GMM_WRONGFILEFMT 1802 ///< Wrong format of input model file '%s'. 01172 #define EMSG_GMM_WRONGVECTORSIZE 1803 ///< Feature vector length '%d' does not match model vector length '%d'. 01173 #define EMSG_GMM_WRONGNBESTSIZE 1804 ///< Requested number of the best gaussians '%d' is bigger than total number of gaussians '%d'. 01174 #define EMSG_GMM_WRONGESTIMFLAGS 1805 ///< Means/variances/weights can not be reestimated if the UBM onces are used. 01175 #define EMSG_GMM_INITNOUBM 1806 ///< Model can not be initialized. Default values are requested but the UBM model is not set. 01176 #define EMSG_GMM_BADNVCTS 1807 ///< Number of vectors in N-best Gaussian evaluation indexes (%d) is lower than number of feature vectors (%d) 01177 #define EMSG_GMM_BADNIDXS 1808 ///< Number of indexed in N-best Gaussian evaluation indexes (%d) is lower than number of evaluated Gussians (%d) 01178 #define EMSG_GMM_NONBESTIDXS 1909 ///< The UBM model does not contain N-best indexes. It must be evaluated at firts. 01179 #define EMSG_GMM_INCOMPSEL1 1910 ///< Number of gaussians in the gaussian pre-selection model '%d' and number of clusters in the pre-selection table does. not agree. 01180 #define EMSG_GMM_INCOMPSEL2 1911 ///< Number of gaussians in the pre-selection table '%d' and in the model '%d' does not agree. 01181 #define WMSG_GMM_EQUALWEIGHTS 8300 ///< Model file '%s' does not contain weights. Equal weights are used. 01182 #define WMSG_GMM_ZEROMEANS 8301 ///< Model file '%s' does not contain means. Equal zero means are used. 01183 #define WMSG_GMM_UNITVARS 8302 ///< Model file '%s' does not contain variances. Unit variances are used. 01184 #define WMSG_GMM_UBMMEANS 8303 ///< Model file '%s' does not contain means. UBM variances are used. 01185 #define WMSG_GMM_UBMVARS 8304 ///< Model file '%s' does not contain variances. UBM variances are used. 01186 #define WMSG_GMM_UBMWEIGHTS 8305 ///< Model file '%s' does not contain weights. UBM weights are used. 01187 #define WMSG_GMM_DEFAULTFACTORS 8306 ///< Model file '%s' does not contain FA factors. Default onces are used. 01188 #define LMSG_GMM_LIKE 8307 ///< Bunch likelihood for instance %p: %f. 01189 01190 01196 #define EMSG_GMML_NOTFOUND 1815 ///< Model '%s' not found. 01197 #define EMSG_GMML_UNKSCMETHOD 1816 ///< Unknown scoring method flag '%s'. Supported flags are 'per_frame', 'per_sentence' and 'decoupled'. 01198 #define EMSG_GMML_INVSCMETHOD 1817 ///< Per frame and per sentence scoring methods can not be used together. 01199 #define EMSG_GMML_UNKESTFLAG 1818 ///< Unknown model estimation flag '%s'. Supported flags are 'means', 'variances', 'weights'. 01200 #define EMSG_GMML_UNKMODELPART 1819 ///< Unknown model part '%s'. Supported model parts are 'means', 'variances', 'weights'. 01201 #define WMSG_GMML_ALREADYEXISTS 8350 ///< Model '%s' already exists. The old model is replaced with new one. 01202 #define WMSG_GMML_NOTFOUND 8351 ///< Model '%s' not found. 01203 01204 01210 #define EMSG_GMMST_IFILE 8370 ///< Can not open gaussian pre-selection table '%s'. 01211 #define EMSG_GMMST_INVVERSION 8371 ///< Invalid version '%d' of gaussian preselection table '%s'. 01212 01213 01219 #define EMSG_FSNIF_OPENDIR 5060 ///< Can not open directory '%s'. 01220 #define EMSG_FSNIF_UNLOCKFILE 5061 ///< Can not unlock file '%s'. 01221 #define EMSG_FSNIF_UNLOCKFILES 5062 ///< Can not unlock all files. 01222 01223 01229 #define EMSG_FLCK_UNLOCKFILE 5080 ///< Can not unlock file '%s'. 01230 01231 01237 #define EMSG_ASNCF_RUNNING 5070 ///< Previous function call is not terminated 01238 #define EMSG_ASNCF_NOTARGET 5071 ///< Target callback object has not been set 01239 #define EMSG_ASNCF_CREATETHREAD 5072 ///< Can not create thread for async function 01240 01241 01247 #define EMSG_SFP_NOTINIT 5500 ///< The speech file preselector is not initialized. The 'Init' function was not called or it end up in an error state. 01248 #define EMSG_SFP_UNINITWFCONV 5501 ///< The waveform format convertor module was not initialized. Possibly not enabled in config file. 01249 #define EMSG_SFP_UNINITCHANSPLIT 5502 ///< The channel splitter module was not initialized. Possibly not enabled in config file. 01250 #define EMSG_SFP_UNINITWFFILTER 5503 ///< The waveform filter module was not initialized. Possibly not enabled in config file. 01251 #define EMSG_SFP_CANNOTCRWAVFILE 5504 ///< Can not create waveform file '%s'. 01252 #define EMSG_SFP_CANNOTWRWAVFILE 5505 ///< Can not write waveform file '%s'. 01253 #define EMSG_SFP_CANNOTCPWAVFILE 5506 ///< Can not copy waveform file from '%s' to '%s'. 01254 #define EMSG_SFP_CANNOTCRSGMFILE 5507 ///< Can not create segmentation file '%s'. 01255 #define EMSG_SFP_CANNOTWRSGMFILE 5508 ///< Can not write segmentation file '%s'. 01256 #define EMSG_SFP_CANNOTCRLOGFILE 5509 ///< Can not create log file '%s'. 01257 #define EMSG_SFP_CANNOTCPACCFILE 5510 ///< Can not copy accompanying files to '%s'. 01258 #define LMSG_SFP_PROCSTARTED 5550 ///< File preselecting started. 01259 #define LMSG_SFP_PROCSTOPPED 5551 ///< File preselecting stopped. 01260 #define LMSG_SFP_PROCWAITING 5552 ///< Available files processed. Waiting for new files... 01261 #define LMSG_SFP_PROCFILE 5553 ///< Processing file '%s'. 01262 01263 01269 #define EMSG_WF_UNSUPPORTEDFMT 8000 ///< Unsupported waveform format, should be array of floats. 01270 #define EMSG_WF_WRONGPARAMS 8001 ///< Detector parameters should be greater or equal to zero. 01271 #define EMSG_WF_UNSUPPORTEDNCHN 8002 ///< Unsupported number of waveform channels, should be one channel waveform. 01272 #define EMSG_WF_FFTINITERR 8003 ///< FFT initialization error. 01273 #define WMSG_WF_WRONGWFSIZE 8050 ///< Wrong waveform size, should be divisible by size of float. 01274 01275 01281 #define EMSG_DSN_CANNOTCRIDXFILE 8050 ///< Can not create index file '%s'. 01282 #define EMSG_DSN_CANNOTOPIDXFILE 8051 ///< Can not open index file '%s'. 01283 #define EMSG_DSN_UNKCONTCAME 8052 ///< Unknown transcription container sent to the 'OnTranscription' function. 01284 #define EMSG_DSN_INVALIDIDXFMT 8053 ///< Invalid format of index file. 01285 #define EMSG_DSN_INVALIDIDXVER 8054 ///< Index file version is '%d' but supported version is '%d'. Please recreate the index file from original waveform. 01286 #define EMSG_DSN_INVALIDIDXPROC 8055 ///< Index file processing mode does not correspond to the processing mode selected. Use 'SetPerSegmentProcessing(%s)' function or recreate index file from original waveform. 01287 #define EMSG_DSN_INVALIDIDXLINE 8056 ///< Invalid line in index file. 01288 #define EMSG_DSN_FILENAMENOTSET 8057 ///< Output file name was not set. Use 'SetFileName' function first. 01289 01290 01296 #define EMSG_TM_UNKCONTCAME 8100 ///< Unknown transcription container came to the 'OnTranscription' function. 01297 #define EMSG_TM_UNKCONTREQ 8101 ///< Unknown transcription container requested by the 'GetTranscription' function. 01298 #define EMSG_TM_SAVEERR 8102 ///< Can not save labels to '%s'. 01299 #define EMSG_TM_LOADERR 8103 ///< Can not load labels from '%s'. 01300 #define EMSG_TM_INVALIDLINE 8104 ///< Invalid line in label file '%s', line %d. 01301 #define EMSG_TM_UNSUPCONT 8105 ///< The 'SendMemory' function supports just the STransOneWord transcription container. 01302 01303 01309 #define EMSG_FM_NOFEATURES 8110 ///< The feature memory does not contain features. 01310 #define EMSG_FM_NOTARGET 8111 ///< The feature memory has no target. If you want to send features, you have to set the target first. Use SFeatureMemoryI::SetTarget() or add a link from SFeatureMemoryI object in the [links] section of config file. 01311 #define EMSG_FM_SAVEMULTMAT 8112 ///< The feature memory contains more than one feature matrix. Saving is implemented only for one feature matrix. 01312 01313 01319 #define EMSG_FS_NOFULLMATRIX 8130 ///< Online processing is not supported, matrix must have PF_OFFLINEPROC flag. 01320 #define EMSG_FS_UNKCONTCAME 8131 ///< Unknown transcription container sent to the 'OnTranscription' function. 01321 #define EMSG_FS_SOUTOFRANGE 8132 ///< Requested segment (%d, %d) is out of feature matrix range (0, %d). 01322 #define EMSG_FS_NOFMATRIX 8133 ///< The feature matrix must be sent to the feature segmenter before transcription. 01323 #define EMSG_FS_SEMPTY 8134 ///< Requested empty segment (%d, %d). 01324 01325 01331 #define EMSG_FSE_NOFULLMATRIX 8135 ///< Online processing is not supported, matrix must have PF_OFFLINEPROC flag. 01332 #define EMSG_FSE_UNKCONTCAME 8136 ///< Unknown transcription container sent to the 'OnTranscription' function. 01333 #define EMSG_FSE_NOFMATRIX 8137 ///< The feature matrix must be sent to the feature segmenter before transcription. 01334 01335 01341 #define EMSG_SMAP_UNKCONTCAME 8120 ///< Unknown transcription container sent to the 'OnTranscription' function. 01342 #define EMSG_SMAP_CANNOTADDSEGM 8121 ///< Can not add segment. Invalid boundaries. 01343 01344 01350 #define EMSG_LMAP_WRONGRULE 8150 ///< Wrong label mapping rule. The rule should have at least the source and target labels separated by space. 01351 01352 01358 #define EMSG_LADJ_WRONGADJFMT 8160 ///< Wrong format of adjustment definition. Should be 'label1 start_shift1 end_shift1;...' 01359 01360 01366 #define EMSG_MT_ROUTOFRANGE 8170 ///< Function 'Get/Set/GetRef' - row index %d is out range (0 : %d). 01367 #define EMSG_MT_COUTOFRANGE 8171 ///< Function 'Get/Set/GetRef' - column index %d is out range (0 ; %d). 01368 #define EMSG_MT_INVALIDRANGE 8172 ///< Function 'GetRangeLength' - invalid range %d:%d:%d. 01369 #define EMSG_MT_CANNOTLOADFILE 8173 ///< Can not load matrix file '%s'. 01370 #define EMSG_MT_CANNOTSAVEFILE 8174 ///< Can not save matrix file '%s'. 01371 #define EMSG_MT_NCOLSMISMATCH 8175 ///< Matrix file '%s' does not have the equal number of values in all rows. 01372 #define EMSG_MT_INVDIMS1 8176 ///< Function 'GEMM' - number of columns in matrix A (%d) and number of rows in matrix B (%d) must agree for matrix multiplication. 01373 #define EMSG_MT_INVDIMS2 8177 ///< Function 'GEMM' - number of rows in matrix A (%d) a in target matrix C (%d) must agree for storing of result from matrix multiplication. 01374 #define EMSG_MT_INVDIMS3 8178 ///< Function 'GEMM' - number of columns in matrix B (%d) a in target matrix C (%d) must agree for storing of result from matrix multiplication. 01375 #define EMSG_MT_INVDIMS4 8179 ///< Function 'Set/Add/Sub/Mul/Div' - matrix size does not agree: target %d x %d, source %d x %d. 01376 #define EMSG_MT_NORECTANGULAR 8180 ///< Function 'Invert' - the matrix is not rectangular (%d x %d). 01377 #define EMSG_MT_SIGNULAR 8181 ///< Function 'Invert' - the matrix is singular. 01378 #define EMSG_MT_UNSUPPORTEDFMT 8182 ///< Unsupported file format (load/save). 01379 #define EMSG_MT_DET 8183 ///< Error in function 'Det'. 01380 #define EMSG_MT_INVDIM5 8184 ///< Function SumRows - invalid dimension of output matrix (%d x %d). Should be (%d x %d). 01381 #define EMSG_MT_INVDIM6 8184 ///< Function SumColumns - invalid dimension of output matrix (%d x %d). Should be (%d x %d). 01382 #define EMSG_MT_INVMEANDIMS 8185 ///< The mean must be a row vector, file '%s'. 01383 01384 01390 #define EMSG_FAC_WRONGDATASIZE 8200 ///< Not enough factors data to set or wrong format. 01391 01392 01398 #define WMSG_CALPHN_NOTSET 8210 ///< Phoneme based calibration constats not loaded or set. 01399 #define EMSG_CALPHN_NOPHNTRANS 8211 ///< PhnTrans must be set before generating phoneme based word shifts. 01400 #define EMSG_CALPHN_FILE 8212 ///< cannot open input file with phncalibration 01401 #define EMSG_CALPHN_INVALIDFMT 8213 ///< Invalid file format with with phncalibration 01402 01403 01409 #define EMSG_FLT_ZEROA 8250 ///< The first coefficient of denominator can not be zero. 01410 #define EMSG_FLT_ZEROB 8251 ///< The first coefficient of numerator can not be zero. 01411 #define EMSG_FLT_INVB 8252 ///< Invalid numerator coefficients in frequency filter. 01412 #define EMSG_FLT_INVA 8253 ///< Invalid denominator coefficients in frequency filter. 01413 #define EMSG_FLT_INVPARAMS 8254 ///< Invalid parameters for filter design. 01414 #define EMSG_FLT_UNKSINCFLTTYPE 8255 ///< Unknown filter type '%s' for the 'sinc' design method. Available filter types are 'lowpass', 'highpass', 'bandpass', 'bandstop'. 01415 #define EMSG_FLT_UNKDESIGNMETHOD 8256 ///< Unknown design method '%s'. The available methods are: 'sinc'. 01416 #define EMSG_FLT_INVDESIGNPARAM1 8257 ///< Invalid design parameters for the Sinc lowpass filter. Should be 'sinc lowpass freq sample_freq magnitude'. 01417 #define EMSG_FLT_INVDESIGNPARAM2 8258 ///< Invalid design parameters for the Sinc highpass filter. Should be 'sinc highpass freq sample_freq magnitude'. 01418 #define EMSG_FLT_INVDESIGNPARAM3 8259 ///< Invalid design parameters for the Sinc bandpass filter. Should be 'sinc bandpass fmin fmax sample_freq magnitude'. 01419 #define EMSG_FLT_INVDESIGNPARAM4 8260 ///< Invalid design parameters for the Sinc bandstop filter. Should be 'sinc bandstop fmin fmax sample_freq magnitude'. 01420 #define EMSG_FLT_UNSUPPORTEDFMT 8261 ///< Unsupported waveform format, should be array of floats. 01421 #define EMSG_FLT_UNSUPPORTEDNCHN 8262 ///< Unsupported number of waveform channels, should be one channel waveform. 01422 01423 #define LMSG_FLT_NOTSTABLE 8270 ///< Filter is not stable. 01424 01425 01431 #define WMSG_WS_DROPOUT 910 ///< The processor is overloaded, there are dropouts in waveform 01432 #define WMSG_WS_UNKSAMPLESIZE 911 ///< Function Format2NBytesPerSample does not know sample size of format %d, setting it to 1 byte. 01433 #define WMSG_WS_FSCONVNOTSET 912 ///< The waveform source does not know how to convert time in seconds to time in samples. Please assign a waveform format convertor by the 'SetWaveformFormatConvertor' function. 01434 01435 01441 #define EMSG_GMMEST_NOTINIT 6100 ///< The GMM based estimator is not initialized. The 'Init' function was not called or it end up in an error state. 01442 #define EMSG_GMMEST_NOMODELS 6101 ///< No models found in directory '%s'. 01443 #define EMSG_GMMEST_MODELSNLOAD 6102 ///< GMM models are not loaded. Call 'LoadModels' function first. 01444 #define EMSG_GMMEST_INVNAMERANGE 6103 ///< Invalid notation of range for extraction of factors form model names '%s'. The notation is 'start:end'. 01445 #define EMSG_GMMEST_UNKCONTCAME 6104 ///< Unknown transcription container sent to the 'OnTranscription' function. 01446 #define EMSG_GMMEST_UNKESTIMMODE 6105 ///< Unknown estimation mode. Should be 'adapt' or 'sum'. 01447 01448 01454 #define EMSG_OFFLSR_FCREATEERR 6201 ///< Can not create output file '%s'. 01455 #define EMSG_OFFLSR_INVSEGMENTS 6202 ///< Invalid setting of start/end frame extension. 01456 #define EMSG_OFFLSR_MKDIRERR 6203 ///< Can not create output directory '%s'. 01457 #define EMSG_OFFLSR_NOTINIT 6204 ///< The recognizer is not initialized. 01458 #define EMSG_OFFLSR_NODECODER 6205 ///< The decoder is not enabled. 01459 #define EMSG_OFFLSR_SAVELAB 6206 ///< Can not create label file '%s'. 01460 #define WMSG_OFFLSR_UNSUPFWARP 7101 ///< The feature extraction modude does not support VTLN warping factor setting. 01461 #define WMSG_OFFLSR_NOTRANSSPLIT 7102 ///< The transcription splitter 'transsplitter_dec' is missing in the config file. Segment will not be mapped to absolute time. 01462 01463 01469 #define EMSG_XML_OPEN 6300 ///< Can not open XML file '%s' 01470 #define EMSG_XML_READ 6301 ///< Unable to read XML file: '%s' 01471 #define EMSG_XML_CREATE 6302 ///< Can not create XML file '%s' 01472 #define EMSG_XML_WRITE 6303 ///< Unable to write XML file: '%s' 01473 #define EMSG_XML_PARSINGERR 6304 ///< XML parsing error - XXX 01474 #define EMSG_XML_MISSINGNAME 6305 ///< Missing property name (\#xxx) for node: '%s' 01475 01476 01482 #define EMSG_KW_MISSINGNAME 6310 ///< The '\<name\>' tag is missing in '\<keyword\>', %s. 01483 #define EMSG_KW_INVATHR 6311 ///< Invalid accept threshold \<accept_thr\> '%s' for keyword '%s', %s. 01484 #define EMSG_KW_INVDTHR 6312 ///< Invalid deny threshold \<deny_thr\> '%s'for keyword '%s', %s. 01485 #define WMSG_KW_NOATHR 6317 ///< Accept threshold '\<accept_thr\>' for keyword '%s' was set to default value 0. 01486 #define WMSG_KW_NODTHR 6318 ///< Denay threshold '\<deny_thr\>' for keyword '%s' was set to default value 0. 01487 01488 01494 #define EMSG_KWL_NOTFOUND 6320 ///< Keyword '%s' was not found in the list. 01495 #define EMSG_KWL_MISSINGNAME 6321 ///< The '\<name\>' tag is missing in '\<keyword\>', file %s. 01496 #define EMSG_KWL_EMPTYNAME 6322 ///< The '\<name\>' tag in '\<keyword\>' can not be empty, file %s. 01497 #define EMSG_KWL_NOPHNTRANS 6323 ///< The phoneme transcription generator is not set. Use the 'SetPhnTrans' function. 01498 #define EMSG_KWL_MISSINGATHR 6324 ///< The '\<accept_thr\>' tag is missing in '\<global\>', file %s. 01499 #define EMSG_KWL_INVGACCTAG 6325 ///< The content of '\<accept_thr\>' tag in '\<global\> (%s) is invalid. 01500 #define EMSG_KWL_MISSINGDTHR 6326 ///< The '\<deny_thr\>' tag is missing in '\<global\>', file %s. 01501 #define EMSG_KWL_INVGGENYTAG 6327 ///< The content of '\<deny_thr\>' tag in '\<global\> (%s) is invalid.', file %s. 01502 #define EMSG_KWL_BADKWNAME 6328 ///< The keyword name '%s' contains unknown characters '%s'. 01503 #define EMSG_KWL_BADPRON 6329 ///< The pronunciation '%s' for keyword '%s' contain unknown phonemes '%s'. 01504 #define EMSG_KWL_NOPRONS 6330 ///< Keyword '%s' does not have pronunciations. 01505 #define EMSG_KWL_PRONGENERR 6331 ///< Can not find or generate pronunciations for keyword '%s'. Check SPhnTrans setting (lexicon or G2P). 01506 #define EMSG_KWL_UNKFFORMAT 6332 ///< Unknown file format. Supported formats are 'ffXML' and 'ffPlain'. 01507 01508 01514 #define EMSG_KWS_NOTINIT 6335 ///< Keyword spotting is not initialized. Call the 'Init' function at first. 01515 #define EMSG_KWS_TMPFILECERR 6336 ///< Can not create temporal file. 01516 #define EMSG_KWS_NOWORDS 6337 ///< The keyword list does not contain valid words (no words or unknown pronunciations or unknown letters). 01517 01518 01524 #define EMSG_PRONL_IDNOTFOUND 6445 ///< Prununciation variant id %d was not found for word %s. 01525 #define EMSG_PRONL_PRONNOTFOUND 6446 ///< Prununciation variant '%s' was not found. 01526 #define EMSG_PRONL_WRONGPROB 6447 ///< Wrong format of pronunciation log probability '%s', tag \<log_prob\>, %s. 01527 01528 01534 #define EMSG_CHS_UEXPTERM 6450 ///< Unexpected termination of UTF8 string '%s'. 01535 #define EMSG_CHS_UNKUTF8CH2 6451 ///< Unknown character in UTF8 string '%s' - wrong followed up bytes. 01536 #define EMSG_CHS_UNKUTF8CH1 5452 ///< Unknown character in UTF8 string - wrong leading byte. 01537 #define EMSG_CHS_WRONGWCH 5453 ///< Wrong unicode character U+%X. 01538 #define EMSG_CHS_OPENCHSTABLE 5454 ///< Can not open char set table '%s'. 01539 #define EMSG_CHS_INVCHSTABLE 5455 ///< The char set table '%s' contain invalid caracter code '%x'. Should be 0x00 to 0xFF. 01540 #define EMSG_CHS_UNKCHAR 5456 ///< Unicode character U+%x does not have its equivalent in used one byte character set. 01541 01542 01548 #define EMSG_KWTHR_KWLISTUNDEF 6450 ///< Keyword list was not set 01549 #define EMSG_KWTHR_WRONGMODE 6451 ///< Mode '%s' is not supported 01550 01551 01557 #define EMSG_TS_UNKMODE 6460 ///< Unknown routing mode '%s'. The supported modes are 'parrallel' or 'serial'. 01558 #define EMSG_TS_UNSUPCONT 6461 ///< The serial mode works with the STransOneWordI container only. The cotainer is '%s'. 01559 01560 01566 #define EMSG_TDST_UNKCONTCAME 6520 ///< Unknown transcription container sent to the 'OnTranscription' function. 01567 01568 01574 #define EMSG_FST2CN_INPNOLIKES 6465 ///< The input finite state transducer does not contain acoustic and language model likelihoods. 01575 #define EMSG_FST2CN_INPNOTIMES 6466 ///< The input finite state transducer does not contain start or end times. 01576 #define EMSG_FST2CN_UNSUPCONT 6467 ///< Only the 'STransFSTI' container is supported. 01577 #define EMSG_FST2CN_NO2STATES 6468 ///< The input transducer should have at least two states. 01578 01579 01585 #define EMSG_FSTT_UNSUPCONT 6530 ///< Only the 'STransFSTI' or 'STransOneWord' container is supported. 01586 #define EMSG_FSTT_UNKSEGLAB 6531 ///< Unknown segmentation label '%s' came to 'OnTranscription'. Supported values are '%s' and '%s'. 01587 #define EMSG_FSTT_OPEN 6532 ///< Can not open file '%s'. 01588 01589 01595 #define EMSG_TRANT_UNSUPCONT 6535 ///< Only the 'STransOneWord' container is supported. 01596 #define EMSG_TRANT_OPEN 6536 ///< Can not open file '%s'. 01597 01598 01604 #define EMSG_FD_WRITEERR 6470 ///< Can not write the feature matrix '%s' 01605 #define EMSG_FD_WRONGMASK 6471 ///< Output file name mask '%s' has to contain at least \%d which will be replaced with segment number. 01606 #define EMSG_FD_UNKFORMAT 6472 ///< Unknow output format '%s'. Use 'ascii' or 'htk'. 01607 01608 01614 #define EMSG_SD_OPENSCOREFILE 6475 ///< Can not open output score file '%s'. 01615 #define EMSG_SD_WRONGMASK 6476 ///< Output filename mask '%s' has to contain %%d which will be replaced by segment number. 01616 #define EMSG_SD_UNKSCOREOFFORMAT 6477 ///< Unknown output file format '%s', supported formats are: Best, RowWise, ColumnWise. 01617 #define EMSG_SD_FILENAMENOTSET 6478 ///< Output file name was not set. Use 'SetFileName' function first. 01618 01619 01625 #define EMSG_GMMSC_NOTINIT 6480 ///< The model for collection was not initialized. Call the 'LoadModel' function at first. 01626 #define EMSG_GMMSC_INVNORM 6481 ///< Normalization of statistic by standard deviation can not be done without normalization by mean. 01627 #define LMSG_GMMSC_STATDUMP 6482 ///< Dump of statistics to log 01628 01629 01635 #define EMSG_2CM_INVMEANDIMS 6490 ///< The mean must be a row vector. 01636 #define EMSG_2CM_INVCWDIMS 6491 ///< Invalid dimensions of the within class covariance matrix (%d x %d), should be the same. 01637 #define EMSG_2CM_INVCADIMS 6492 ///< Invalid dimensions of the across class covariance matrix (%d x %d), should be the same. 01638 #define EMSG_2CM_INVDIMS 6493 ///< The dimensions of within class (%d x %d) and accross class (%d x %d) covariance matrices are not the same. 01639 #define EMSG_2CM_INVMUDIMS 6494 ///< The dimensions of mean vector (%d x %d) does not agree. Should be (%d x %d). 01640 #define EMSG_2CM_INVD1DIMS 6495 ///< The number of features in data set one (%d) does not agree with the model (%d). 01641 #define EMSG_2CM_INVD2DIMS 6496 ///< The number of features in data set two (%d) does not agree with the model (%d). 01642 #define EMSG_2CM_NOTMATSLOADED1 6497 ///< All mean, within class covariance matrix and accross class covarinace matrix must be loaded before the two covariance model is used. 01643 #define EMSG_2CM_NOTPOSDEF 6498 ///< Invalid within class or accross class covariance matrix. It is not positive-definite. 01644 #define EMSG_2CM_REGOVERFLOW 6499 ///< Matrix aritmetic overfow. Please use better input parameters - within and accross class covariance matrices. 01645 #define EMSG_2CM_NOTMATSLOADED2 6500 ///< All R, S, T, and U must be loaded before the two covariance model is used. 01646 #define EMSG_2CM_INVRMAT 6501 ///< The R matrix must be rectangular. 01647 #define EMSG_2CM_INVSMAT 6502 ///< The S matrix must be rectangular with the same number of rows (%d) as in the R matrix (%d). 01648 #define EMSG_2CM_INVTMAT 6503 ///< The T must be a column vector with the same number of dimensions (%d) as number of rows in the R matrix (%d). 01649 #define EMSG_2CM_INVIMAT 6504 ///< The U must be a scalar value. 01650 #define EMSG_2CM_UNKMATFORMAT 6505 ///< Unknown matrix file format '%s'. The supported variables are: 'ascii', 'htk' and 'binary'. 01651 #define EMSG_2CM_NODATAFILES 6506 ///< Missing data files. The R, S, T, U matrices or within class, across class matrices and mean vector are necesary 01652 #define EMSG_2CM_NOWCACMFILES 6507 ///< The within class, across class matrices and mean vector are necesary to produce the alternative RSTU representation. 01653 #define EMSG_2CM_NORSTUFNAMES 6508 ///< The R, S, T, U matrix files must be specified when the RSTU representation is being saved. 01654 01655 01661 #define EMSG_VP_CORRUPTED 6541 ///< The voice-print file '%s' is corrupted (%d). 01662 #define EMSG_VP_FOPEN 6542 ///< Can not open voice-print file '%s'. 01663 #define EMSG_VP_FREAD 6543 ///< Can not read voice-print file '%s'. 01664 #define EMSG_VP_FCREATE 6547 ///< Can not create voice-print file '%s'. 01665 #define EMSG_VP_NOTASSIGNED 6578 ///< The voice-print was not assigned to the container. Use 'SetData' or 'SetContentData' or 'Load' before 'Save'. 01666 #define EMSG_VP_FWRITE 6549 ///< Can not write voice-print file '%s'. 01667 #define EMSG_VP_INVHEADER 6550 ///< Invalid header of voice-print data block. 01668 01669 01675 #define EMSG_VPE_UNKCONTAINER 6560 ///< Unknown voice print container (%d) came from the BlockSet 'output_node'. 01676 #define EMSG_VPE_CANNOTMKDIR 6561 ///< Can not create output directory '%s'. 01677 #define EMSG_VPE_NOTINIT 6562 ///< The voice-print extractor is not initialized. The 'Init' function was not called or it end up in an error state. 01678 #define LMSG_VPE_PROCFILE 6565 ///< Processing file: %s 01679 #define LMSG_VPE_PROCLIST 6566 ///< Processing list: %s 01680 #define LMSG_VPE_PROCDIR 6567 ///< Processing directory: %s 01681 #define LMSG_VPE_PROCWF 6568 ///< Processing waveform: %s 01682 #define WMSG_VPE_NOTSIGRESULT 6569 ///< Record(s) for creating the voice print contain only %.3f seconds of speech. At least %.3f seconds are needed to obtain significant results. 01683 01684 01690 #define EMSG_VPC_NOCOMP 6570 ///< Two set comparator is not set. Call the 'SetTwoSetComparator' function at first. 01691 #define LMSG_VPC_CMPSETS 6571 ///< Comparing set of %d voice prints against set of %d voice prints. 01692 #define LMSG_VPC_CMPLISTS 6572 ///< Comparing voice print lists: '%s', '%s'. 01693 #define LMSG_VPC_CMPVPS 6573 ///< Comparing voice prints: '%s', '%s'. 01694 #define LMSG_VPC_CMPFILES 6574 ///< Comparing voice print files: '%s', '%s'. 01695 #define LMSG_VPC_CMPDIRS 6575 ///< Comparing voice print directories: '%s', '%s'. 01696 01697 01703 #define EMSG_VPS_EMPTYLIST 6700 ///< Empty list of voice-print files '%s'. 01704 #define EMSG_VPS_EMPTYDIR 6701 ///< Empty directory '%s' for mask '*.%s'. 01705 #define EMSG_VPS_EMPTYSET 6702 ///< Empty set of voice-prints. 01706 01707 01713 #define EMSG_VPUC_UNKMATFORMAT 6720 ///< Unknown file format '%s'. Call 'SetFileFormatStr' with 'ascii', 'htk' or 'binary'. 01714 #define EMSG_VPUC_MEANNOTVALID 6721 ///< Mean vector has not been estimated or loaded yet. Use 'StartEstimation'/'EndEstimation' or 'Load' first. 01715 #define EMSG_VPUC_UNSUPCONT 6722 ///< Unsupported container '%s' came to 'OnParameters' function. Supported type is '%s'. 01716 #define EMSG_VPUC_DIMNOTEQUAL 6723 ///< Dimension of voice-print '%d' and mean vector '%d' does not match. 01717 #define WMSG_VPUC_TOOSHORT 6730 ///< Voice-print '%s' will not be used for calibration parameters estimation. Record(s) for creating the voice print contain only %.3f seconds of speech. At least %.3f seconds are needed for the voice-print to be used. 01718 01719 01725 #define EMSG_DIA_OFILE 6590 ///< Can not open file '%s' for saving waveform. 01726 #define LMSG_DIA_PROCFILE 6595 ///< Processing file: %s 01727 #define LMSG_DIA_PROCLIST 6596 ///< Processing list: %s 01728 #define LMSG_DIA_PROCDIR 6597 ///< Processing directory: %s 01729 #define LMSG_DIA_PROCWF 6598 ///< Processing waveform: %s 01730 01731 01737 #define EMSG_L2F_UNSUPCONT 6580 ///< Only the 'STransLatticeI' container is supported. 01738 01739 01745 #define EMSG_MTX_CANNOTINIT 6520 ///< Mutex initialization failed. 01746 #define EMSG_MTX_CANNOTLOCK 6521 ///< Mutex lock failed. 01747 #define EMSG_MTX_CANNOTUNLOCK 6522 ///< Mutex unlock failed. 01748 01749 01755 #define WMSG_VTLN_NOMEMORY 6000 ///< Memory allocation error. The default warping factor 1 was used. 01756 #define WMSG_VTLN_UNSUPFEXTR 6001 ///< The feature extraction module does not support warping of frequency. The default warping factor 1 used. 01757 #define WMSG_VTLN_NOFEXTR 6002 ///< The feature extraction module in speech recognizer was not initialized. The default warping factor 1 used. => enable it in config file 01758 #define WMSG_VTLN_NODATA 6003 ///< Not enough data to estimate warping factor. The default factor 1 was used 01759 #define WMSG_VTLN_NOWFCONV 6004 ///< The waveform format convertor module in speech recognizer was not initialized. The default warping factor 1 was used. => enable it in config file 01760 01761 01767 #define EMSG_CMLLRE_UNKCONTCAME 6400 ///< Unknown statistics container sent to the 'OnStatistics' function. 01768 01769 01775 #define EMSG_IVE_NOIMATRIX 6420 ///< The IMatrix was not loaded. The matrix must be loaded before the extractor is used. 01776 #define EMSG_IVE_UNSUPSTATS 6421 ///< Unsupported statistics container (%d) came to the 'OnStatistics' function. 01777 #define EMSG_IVE_NOMODELPTR 6422 ///< The pointer to model is not set for the SStatsGMMI container (came to OnStatistics), or it is not the SGMM model. The model is necessary for the collapsed computation. 01778 #define EMSG_IVE_COLLAPSEDNBEST 6423 ///< The collapsed computation can not be used with n-best. Please disable n-best by setting it to 0. 01779 #define EMSG_IVE_NOVIVITMATS 6424 ///< The IMatrix must be loaded and at least one ivector extracted before the ViVit matrices are available. 01780 #define EMSG_IVE_INCOMPMATDIMS 6425 ///< Incomatible matrix dimensions. Check the IMatrix (neigs x nmixtures * vector_size), ViVitMatrix (neigs x ngeigs * nsubmats) and the setting of collapsed computations. nsubmats is equal to nmixtures if no collapsed computation is enabled. 01781 #define EMSG_IVE_INCOMPVECDIMS 6426 ///< Incompatible dimensions of mean vector (%d) and iVector (%d). 01782 #define EMSG_IVE_IMX2MEMFAIL 6427 ///< Cannot load IMatrix into the object memory. 01783 #define EMSG_IVE_IMXFROMMEMFAIL 6428 ///< Cannot load IMatrix from the object memory. 01784 #define EMSG_IVE_VVALL2MEMFAIL 6429 ///< Cannot load calculated ViVitAll matrix into the object memory. 01785 #define EMSG_IVE_VVALLFROMMEMFAIL 6430 ///< Cannot load calculated ViVitAll matrix from the object memory. 01786 #define EMSG_IVE_INVALIDMFILE 6431 ///< Invalid matrix file name. 01787 01788 01794 #define EMSG_VQ_NOFULLMATRIX 6600 ///< Online processing is not supported, matrix must have PF_OFFLINEPROC flag. 01795 #define EMSG_VQ_UNKDISTFUNC 6601 ///< Unknown distance function '%s'. Supported distance functions are 'euclidean', 'cosine'. 01796 01797 01803 #define EMSG_GML_NOGMMLIST 7750 ///< The GMMList pointer was not specified. Please call the SetGMMList function at first. 01804 #define EMSG_GML_TOOMANYITERS 7751 ///< Exceeded number of requested training iterations. 01805 #define EMSG_GML_CANNOTRMMODEL 7752 ///< Can not remove model '%s'. Model file '%s' can not be removed from a drive. 01806 #define EMSG_GML_CANNORRENMOD1 7752 ///< Can not rename model '%s' to '%s'. The target model already exists. 01807 #define EMSG_GML_CANNORRENMOD2 7753 ///< Can not rename model '%s' to '%s'. The source model does not exist. 01808 #define EMSG_GML_CANNORRENMOD3 7754 ///< Can not rename model '%s' to '%s' because corresponding files '%s' and '%s' can not be renamed. 01809 #define EMSG_GML_CANNOTRMBAK 7755 ///< Can not remove old backup file '%s'.", pfile); 01810 01811 01817 #define EMSG_IV2VP_UNKCONTAINER 7760 ///< Unknown voice print container (%d) passed to SIVectorToVoicePrintConvertor::OnParameters 01818 01819 01825 #define EMSG_VPML_UNKCONT 7765 ///< Unknown voice-print container came to SVoicePrintModelList. 01826 #define EMSG_VPML_NOCOMP 7766 ///< Comparator is not set. Call the 'SetVoicePrintComparator' at first. 01827 01828 01834 #define EMSG_SCM_NOSCORE 7770 ///< The score memory does not have score container. The 'OnScores' must be called before 'GetScores'. 01835 01836 01842 #define EMSG_SCMRG_SCOREDIMNOTEQ 7800 ///< Number of scores %d does not match %d. 01843 #define EMSG_SCMRG_UNKBESTMETHOD 7801 ///< Unknown best name method %d. 01844 01845 01851 #define EMSG_VAD_UNSUPPORTEDFMT 9100 ///< Unsupported waveform format, should be array of floats 01852 01853 01859 #define EMSG_F0C_UNKF0STATE 9150 ///< Unknown coding of f0 state. The known states are >=0, -1, -2, -3. 01860 01861 01867 #define EMSG_SC_NOTINIT 9160 ///< The SScores container is not initialized. Call the 'Init' function at first. 01868 #define EMSG_SC_INVINDEX 9161 ///< Invalid index to names or scores - GetName/GetScore/SetName/SetScore. 01869 #define EMSG_SC_UNKBNMETHOD 9162 ///< Unknown method to get the best name '%s', supported methods are 'max' and 'min'. 01870 01871 01877 #define EMSG_STR_INVSCORES 9170 ///< Invalid scores. Can not apply score transform. 01878 #define EMSG_STR_UNKSCORETRANSF 9171 ///< Unknown score transform '%s', supported transforms are: Raw, LogLike2PostProb, LogLike2LogPostProb, LogLikeBg2PostProb, LogLikeBg2LogPostProb, LogLike2LLR, LogLikeBg2LLR, LogLike2LLRBg, LLR2PostProb, LLR2LogPostProb. 01879 01880 01886 #define EMSG_IVCT2FM_UNKCONTCAME 9180 ///< Unknown parameters container sent to the 'OnParameters' function. 01887 01888 01894 #define EMSG_INDTOSEGM_NOCHUNKSIZE 9190 ///< Chunk size must be set. 01895 #define EMSG_INDTOSEGM_UNKCONTCAME 9191 ///< Unknown parameters container sent to the 'OnParameters' function. 01896 01897 01903 #define EMSG_MULT_NOTNOC 7010 ///< Number of cores must be set before initialization. 01904 #define EMSG_MULT_NOBSET 7011 ///< For getting blockset use GetVPExtractors(). (extractors = GetVPExtractors() and extractors[i]->GetBlockSet()). 01905 01906 01908 // Interfaces 01910 01911 class SErrorCallbackI; 01912 class SBlockSetI; 01913 class SWaveformFormatConvertorI; 01914 class SFeatureExtractionI; 01915 class SFeatureTransformI; 01916 class SGrammarCompilerGroupI; 01917 class SFloatMatrixI; 01918 class SIntMatrixI; 01919 class SDecoderI; 01920 class SERestI; 01921 class SSignalModellingI; 01922 class SFactorAnalysisI; 01923 class SFactorsI; 01924 class STranscriptionI; 01925 class SXMLDocumentI; 01926 class SPronunciationListI; 01927 class SKeywordListI; 01928 class SParametersI; 01929 class SStatisticsI; 01930 class SPhnTransI; 01931 class SGMMI; 01932 class SWaveformI; 01933 class SScoresI; 01934 class STransFSTExtensionI; 01935 class SVoicePrintComparatorI; 01936 class SWaveformEditorPanelI; 01937 01938 #ifndef _BSAPI_LITE_H 01939 01947 class SUnknownI 01948 { 01949 public: 01954 virtual unsigned int BSAPI_METHOD AddRef() = 0; 01959 virtual unsigned int BSAPI_METHOD Release() = 0; 01965 virtual unsigned int BSAPI_METHOD GetIID() = 0; 01966 01975 virtual void BSAPI_METHOD SetErrorHandler(SErrorCallbackI *pErrorHandler) = 0; 01976 01980 virtual SErrorCallbackI * BSAPI_METHOD GetErrorHandler() = 0; 01981 }; 01982 #endif 01983 01984 01985 01992 class SWaveformSourceCallbackI 01993 { 01994 public: 01997 typedef enum 01998 { 01999 wfUnknown, 02000 wfUnsupported, 02001 wfLin16, 02002 wfLin8, 02003 wfALaw, 02004 wfMuLaw, 02005 wfFloat 02006 } wave_format_type; 02007 02019 virtual bool BSAPI_METHOD OnWaveform(SUnknownI *pSender, wave_format_type waveformFormat, int sampleFreq, int nChannels, void *pData, int nBytes, unsigned int flags) = 0; 02020 }; 02021 02024 class SWaveformEditorCallbackI 02025 { 02026 public: 02031 virtual void BSAPI_METHOD DrawPixel(int x, int y, rgba_type color) = 0; 02032 02039 virtual void BSAPI_METHOD DrawLine(int x1, int y1, int x2, int y2, rgba_type color) = 0; 02040 02047 virtual void BSAPI_METHOD DrawBox(int x, int y, int width, int height, rgba_type color) = 0; 02048 02055 virtual void BSAPI_METHOD DrawTextLabel(int x, int y, const char* text, int fontSize, rgba_type color) = 0; 02056 }; 02057 02060 class SWaveformEditorHighlightingI : public SUnknownI 02061 { 02062 public: 02064 virtual void BSAPI_METHOD SetEnabled(bool enabled) = 0; 02066 virtual void BSAPI_METHOD SetStart(double startTime) = 0; 02068 virtual void BSAPI_METHOD SetEnd(double endTime) = 0; 02070 virtual void BSAPI_METHOD SetScore(float score) = 0; 02072 virtual void BSAPI_METHOD SetUserData(SUnknownI* pData) = 0; 02073 02075 virtual bool BSAPI_METHOD GetEnabled() = 0; 02077 virtual double BSAPI_METHOD GetStart() = 0; 02079 virtual double BSAPI_METHOD GetEnd() = 0; 02081 virtual float BSAPI_METHOD GetScore() = 0; 02083 virtual SUnknownI* BSAPI_METHOD GetUserData() = 0; 02084 }; 02085 02088 class SWaveformEditorHighlightingListI : public SUnknownI 02089 { 02090 public: 02092 virtual void BSAPI_METHOD Clear() = 0; 02094 virtual bool BSAPI_METHOD Add(SWaveformEditorHighlightingI* pHighlighting) = 0; 02096 virtual void BSAPI_METHOD Remove(int id) = 0; 02098 virtual void BSAPI_METHOD First() = 0; 02100 virtual SWaveformEditorHighlightingI* BSAPI_METHOD Get() = 0; 02101 }; 02102 02105 class SWaveformEditorI : public SUnknownI 02106 { 02107 public: 02109 virtual void BSAPI_METHOD OnPaint() = 0; 02110 02114 virtual void BSAPI_METHOD OnMouseDown(int x, int y) = 0; 02115 02119 virtual void BSAPI_METHOD OnMouseUp(int x, int y) = 0; 02120 02124 virtual void BSAPI_METHOD OnMouseMove(int x, int y) = 0; 02125 02127 virtual bool BSAPI_METHOD AddPanel(SWaveformEditorPanelI* pPanel) = 0; 02129 virtual void BSAPI_METHOD RemovePanel(SWaveformEditorPanelI* pPanel) = 0; 02131 virtual void BSAPI_METHOD SynchPanels() = 0; 02132 02134 virtual bool BSAPI_METHOD SetEditorSize(int width, int height) = 0; 02136 virtual bool BSAPI_METHOD SetView(double timeStart, double timeEnd) = 0; 02138 virtual bool BSAPI_METHOD SetSelection(double timeStart, double timeEnd) = 0; 02141 virtual bool BSAPI_METHOD SetScale(double scale) = 0; 02143 virtual void BSAPI_METHOD ZoomToSelection() = 0; 02145 virtual void BSAPI_METHOD ShiftLeft() = 0; 02147 virtual void BSAPI_METHOD ShiftRight() = 0; 02149 virtual void BSAPI_METHOD SetHighlightings(SWaveformEditorHighlightingListI* pHLightList) = 0; 02151 virtual void BSAPI_METHOD SetCursorPosition(double time) = 0; 02152 02154 virtual double BSAPI_METHOD GetViewStartTime() = 0; 02156 virtual double BSAPI_METHOD GetViewEndTime() = 0; 02158 virtual double BSAPI_METHOD GetSelectionStart() = 0; 02160 virtual double BSAPI_METHOD GetSelectionEnd() = 0; 02162 virtual double BSAPI_METHOD GetScale() = 0; 02163 }; 02164 02167 class SWaveformEditorPanelI : public SUnknownI 02168 { 02169 public: 02172 typedef enum 02173 { 02174 ctBackground, 02175 ctSelection, 02176 ctSelectionBorder, 02177 ctCursor, 02178 ctText, 02179 ctHighlight, 02180 ctChannel0, 02181 ctChannel1, 02182 ctChannel2, 02183 ctChannel3 02184 } color_type; 02185 02187 virtual void BSAPI_METHOD OnPaint() = 0; 02188 02192 virtual void BSAPI_METHOD OnMouseDown(int x, int y) = 0; 02193 02197 virtual void BSAPI_METHOD OnMouseUp(int x, int y) = 0; 02198 02202 virtual void BSAPI_METHOD OnMouseMove(int x, int y) = 0; 02203 02205 virtual void BSAPI_METHOD SetPanelId(int id) = 0; 02207 virtual bool BSAPI_METHOD SetPanelSize(int width, int height) = 0; 02209 virtual bool BSAPI_METHOD SetNChannels(int nChannels) = 0; 02211 virtual bool BSAPI_METHOD SetSampleFreq(int sampleFreq) = 0; 02213 virtual void BSAPI_METHOD SetPanelCallback(SWaveformEditorCallbackI* pPanelCallback) = 0; 02216 virtual bool BSAPI_METHOD SetChannel(int channel) = 0; 02218 virtual void BSAPI_METHOD SetColor(rgba_type color, color_type type) = 0; 02220 virtual void BSAPI_METHOD SetMaxTime(double time) = 0; 02222 virtual bool BSAPI_METHOD SetView(double timeStart, double timeEnd) = 0; 02224 virtual bool BSAPI_METHOD SetSelection(double timeStart, double timeEnd) = 0; 02227 virtual bool BSAPI_METHOD SetScale(double scale) = 0; 02229 virtual void BSAPI_METHOD ZoomToSelection() = 0; 02231 virtual void BSAPI_METHOD ShiftLeft() = 0; 02233 virtual void BSAPI_METHOD ShiftRight() = 0; 02235 virtual void BSAPI_METHOD SetHighlightings(SWaveformEditorHighlightingListI* pHLightList) = 0; 02237 virtual void BSAPI_METHOD SetCursorPosition(double time) = 0; 02238 02240 virtual int BSAPI_METHOD GetPanelID() = 0; 02242 virtual int BSAPI_METHOD GetNChannels() = 0; 02244 virtual int BSAPI_METHOD GetSampleFreq() = 0; 02246 virtual double BSAPI_METHOD GetMaxTime() = 0; 02248 virtual int BSAPI_METHOD GetPanelHeight() = 0; 02250 virtual int BSAPI_METHOD GetPanelWidth() = 0; 02253 virtual int BSAPI_METHOD GetChannel() = 0; 02255 virtual double BSAPI_METHOD GetViewStartTime() = 0; 02257 virtual double BSAPI_METHOD GetViewEndTime() = 0; 02259 virtual double BSAPI_METHOD GetSelectionStart() = 0; 02261 virtual double BSAPI_METHOD GetSelectionEnd() = 0; 02263 virtual double BSAPI_METHOD GetScale() = 0; 02265 virtual rgba_type BSAPI_METHOD GetColor(color_type type) = 0; 02267 virtual bool BSAPI_METHOD IsReady() = 0; 02268 02269 }; 02270 02273 class SWaveformDataI : public SUnknownI 02274 { 02275 public: 02276 virtual bool BSAPI_METHOD SetNChannels(int nChannels) = 0; 02277 virtual bool BSAPI_METHOD SetSampleFreq(int sampleFreq) = 0; 02278 virtual bool BSAPI_METHOD SetFormat(SWaveformSourceCallbackI::wave_format_type format) = 0; 02279 virtual bool BSAPI_METHOD SetWaveform(float* pData, int length) = 0; 02280 virtual bool BSAPI_METHOD LoadFile(const char* pFile) = 0; 02281 virtual void BSAPI_METHOD Clear() = 0; 02282 02283 virtual int BSAPI_METHOD GetNChannels() = 0; 02284 virtual int BSAPI_METHOD GetSampleFreq() = 0; 02285 virtual SWaveformSourceCallbackI::wave_format_type BSAPI_METHOD GetFormat() = 0; 02286 virtual float* BSAPI_METHOD GetData() = 0; 02287 virtual int BSAPI_METHOD GetDataLength() = 0; 02288 virtual const char* BSAPI_METHOD GetFileName() = 0; 02289 02290 virtual bool BSAPI_METHOD IsLoaded() = 0; 02291 02293 virtual SWaveformI* BSAPI_METHOD GetCopy(double startTime, double endTime) = 0; 02295 virtual bool BSAPI_METHOD Paste(SWaveformI* pData, double position) = 0; 02297 virtual SWaveformI* BSAPI_METHOD Cut(double startTime, double endTime) = 0; 02298 }; 02299 02302 class SWEPWaveformPanelI : public SWaveformEditorPanelI 02303 { 02304 public: 02306 virtual bool BSAPI_METHOD SetWaveformData(SWaveformDataI* pData) = 0; 02308 virtual void BSAPI_METHOD Clear() = 0; 02310 virtual void BSAPI_METHOD SetMinMaxNormalization(bool normalization) = 0; 02311 02312 virtual bool BSAPI_METHOD GetMinMaxNormalization() = 0; 02313 }; 02314 02317 class SWEPPowerPanelI : public SWaveformEditorPanelI 02318 { 02319 public: 02321 virtual bool BSAPI_METHOD SetWaveformData(SWaveformDataI* pData) = 0; 02322 }; 02323 02326 class SWEPTimePanelI : public SWaveformEditorPanelI 02327 { 02328 public: 02331 typedef enum 02332 { 02333 dfSeconds, 02334 dfTime, 02335 dfFrames 02336 } display_format; 02337 02339 virtual void BSAPI_METHOD SetDisplayFormat(display_format format) = 0; 02341 virtual display_format BSAPI_METHOD GetDisplayFormat() = 0; 02342 }; 02343 02346 class SWEPLabelPanelI : public SWaveformEditorPanelI 02347 { 02348 public: 02350 virtual bool BSAPI_METHOD LoadFile(const char* pFile) = 0; 02352 virtual void BSAPI_METHOD Clear() = 0; 02354 virtual void BSAPI_METHOD SetScoreTreshold(float treshold) = 0; 02356 virtual float BSAPI_METHOD GetScoreTreshold() = 0; 02358 virtual void BSAPI_METHOD GetMinMaxScore(float& min, float& max) = 0; 02359 }; 02360 02363 class SFeatureExtractionCallbackI 02364 { 02365 public: 02366 virtual bool BSAPI_METHOD OnFeatureMatrix(SUnknownI *pSender, SFloatMatrixI *pMatrix, int nFrames, unsigned int flags) = 0; 02367 }; 02368 02371 class SFileListCallbackI 02372 { 02373 public: 02374 virtual void BSAPI_METHOD OnStart() = 0; 02375 virtual void BSAPI_METHOD OnEnd() = 0; 02376 02377 // In case the callback functions return false, the processing will be terminated 02378 virtual bool BSAPI_METHOD OnLine(const char *pTarget, const char *pSource, int start, int end, float prob) = 0; 02379 virtual bool BSAPI_METHOD OnFileChanged(const char *pOldFile, const char *pNewFile) = 0; 02380 }; 02381 02382 #ifndef _BSAPI_LITE_H 02383 02395 class SErrorCallbackI 02396 { 02397 public: 02400 typedef enum 02401 { 02402 mtError, 02403 mtWarning, 02404 mtLog 02405 } message_type; 02406 02414 virtual void BSAPI_METHOD OnTextMessage(SUnknownI *pSender, message_type type, unsigned int messageId, const char *pMessage) = 0; 02415 }; 02416 #endif 02417 02420 class STextMessageI : public SUnknownI 02421 { 02422 public: 02423 virtual bool BSAPI_METHOD SetComponentName(const char *pComponentName) = 0; 02424 virtual void BSAPI_METHOD SetInterfaceId(unsigned int interfaceId) = 0; 02425 virtual void BSAPI_METHOD SetType(SErrorCallbackI::message_type type) = 0; 02426 virtual void BSAPI_METHOD SetId(unsigned int id) = 0; 02427 virtual bool BSAPI_METHOD SetText(const char *pText) = 0; 02428 02429 virtual const char * BSAPI_METHOD GetComponentName() = 0; 02430 virtual unsigned int BSAPI_METHOD GetInterfaceId() = 0; 02431 virtual SErrorCallbackI::message_type BSAPI_METHOD GetType() = 0; 02432 virtual unsigned int BSAPI_METHOD GetId() = 0; 02433 virtual const char * BSAPI_METHOD GetText() = 0; 02434 }; 02435 02438 class SErrorHandlerI : public SUnknownI, public SErrorCallbackI 02439 { 02440 public: 02441 virtual int BSAPI_METHOD GetMaximalCapacity() = 0; 02442 virtual bool BSAPI_METHOD SetMaximalCapacity(int maximalCapacity) = 0; 02443 02444 virtual bool BSAPI_METHOD SetDefaultHandlerName(const char *pDefaultHandlerName) = 0; 02445 02446 virtual bool BSAPI_METHOD ClearMessages() = 0; 02447 virtual bool BSAPI_METHOD FirstMessage() = 0; 02448 virtual STextMessageI * BSAPI_METHOD GetTextMessage() = 0; 02449 virtual STextMessageI * BSAPI_METHOD GetLastMessage() = 0; 02450 virtual int BSAPI_METHOD GetNMessages() = 0; 02451 02452 virtual SErrorCallbackI * BSAPI_METHOD GetErrorHandlerByName(const char *pName) = 0; 02453 }; 02454 02457 class SSpeechRecStateCallbackI 02458 { 02459 public: 02460 typedef enum {stUnknown, stCreated, stInitialized, stListStarted, stUtteranceStarted, stUtteranceFinished, stListFinished, stDestroyed} state_type; 02461 02462 // In case the callback functions return false, the processing will be terminated 02463 virtual bool BSAPI_METHOD OnStateChanged(state_type state) = 0; 02464 virtual bool BSAPI_METHOD OnFileChanged(const char *pOldFile, const char *pNewFile) = 0; 02465 }; 02466 02469 class SFileSnifferCallbackI 02470 { 02471 public: 02472 typedef enum {stLoopStarted, stTerminated, stWaitForData} state_type; 02473 02474 virtual bool BSAPI_METHOD OnFile(const char *pFile) = 0; 02475 virtual bool BSAPI_METHOD OnStateChanged(state_type state) = 0; 02476 }; 02477 02480 class SAsyncFuncCallbackI 02481 { 02482 public: 02483 virtual void * BSAPI_METHOD OnRunAsync(void *pArgument) = 0; 02484 virtual void BSAPI_METHOD OnComplete(void *pRetValue) = 0; 02485 }; 02486 02489 class STransCallbackI 02490 { 02491 public: 02492 virtual bool BSAPI_METHOD OnTranscription(SUnknownI *pSender, STranscriptionI *pTrans) = 0; 02493 }; 02494 02497 class SChannelCallbackI 02498 { 02499 public: 02500 virtual bool BSAPI_METHOD OnChannelChanged(SUnknownI *pSender, int channel) = 0; 02501 }; 02502 02505 class SOfflineSpeechRecCallbackI 02506 { 02507 public: 02514 virtual bool BSAPI_METHOD OnFileStarted(const char *pInputFile, const char *pOutputFile) = 0; 02515 02524 virtual bool BSAPI_METHOD OnSegmentStarted(long_long segmentStart, long_long segmentEnd, int channel, const char *pTranscriptionFile) = 0; 02525 02532 virtual bool BSAPI_METHOD OnTranscription(SUnknownI *pSender, STranscriptionI *pTrans) = 0; 02533 02543 virtual bool BSAPI_METHOD OnSegmentDone(long_long segmentStart, long_long segmentEnd, int channel, const char *pTranscriptionFile, bool isValid) = 0; 02544 02551 virtual bool BSAPI_METHOD OnFileDone(const char *pInputFile, const char *pOutputFile) = 0; 02552 }; 02553 02557 class SConfigureCallbackI 02558 { 02559 public: 02560 virtual bool BSAPI_METHOD OnConfigLineLoading(char *pConfigLine) = 0; 02561 }; 02562 02565 class SParametersCallbackI 02566 { 02567 public: 02568 virtual bool BSAPI_METHOD OnParameters(SUnknownI *pSender, SParametersI *pParameters) = 0; 02569 }; 02570 02573 class SStatisticsCallbackI 02574 { 02575 public: 02576 virtual bool BSAPI_METHOD OnStatistics(SUnknownI *pSender, SStatisticsI *pStatistics) = 0; 02577 }; 02578 02581 class SScoreCallbackI 02582 { 02583 public: 02584 virtual bool BSAPI_METHOD OnScores(SUnknownI *pSender, SScoresI *pScores) = 0; 02585 }; 02586 02590 class STranscriptionI : public SUnknownI 02591 { 02592 public: 02593 virtual bool BSAPI_METHOD Save(const char *pFile) = 0; 02594 virtual bool BSAPI_METHOD Load(const char *pFile) = 0; 02595 virtual bool BSAPI_METHOD Assign(STranscriptionI *pSource) = 0; 02596 02597 virtual int BSAPI_METHOD GetChannel() = 0; 02598 virtual bool BSAPI_METHOD GetIsLast() = 0; 02599 virtual bool BSAPI_METHOD GetIsValid() = 0; 02600 02601 virtual void BSAPI_METHOD SetChannel(int channel) = 0; 02602 virtual void BSAPI_METHOD SetIsLast(bool last) = 0; 02603 virtual void BSAPI_METHOD SetIsValid(bool valid) = 0; 02604 }; 02605 02608 class STransOneWordI : public STranscriptionI 02609 { 02610 public: 02611 virtual char * BSAPI_METHOD GetWord() = 0; 02612 virtual long_long BSAPI_METHOD GetStart() = 0; 02613 virtual long_long BSAPI_METHOD GetEnd() = 0; 02614 virtual float BSAPI_METHOD GetScore() = 0; 02615 virtual float BSAPI_METHOD GetConfidence() = 0; 02616 virtual bool BSAPI_METHOD GetIsImprovedEstim() = 0; 02617 02618 virtual bool BSAPI_METHOD SetWord(const char *pWord) = 0; 02619 virtual void BSAPI_METHOD SetStart(long_long start) = 0; 02620 virtual void BSAPI_METHOD SetEnd(long_long end) = 0; 02621 virtual void BSAPI_METHOD SetScore(float score) = 0; 02622 virtual void BSAPI_METHOD SetConfidence(float confidence) = 0; 02623 virtual void BSAPI_METHOD SetIsImprovedEstim(bool improvedEstim) = 0; 02624 }; 02625 02628 class STransOneBestI : public STranscriptionI 02629 { 02630 public: 02631 virtual float BSAPI_METHOD GetScore() = 0; 02632 virtual float BSAPI_METHOD GetConfidence() = 0; 02633 02634 virtual void BSAPI_METHOD SetScore(float score) = 0; 02635 virtual void BSAPI_METHOD SetConfidence(float confidence) = 0; 02636 }; 02637 02640 class STransLatticeI : public STranscriptionI 02641 { 02642 public: 02643 typedef enum {ffSTK, ffHTK} file_format_type; 02644 02645 virtual bool BSAPI_METHOD SaveFmt(const char *pFile, file_format_type format) = 0; 02646 virtual float BSAPI_METHOD GetScore() = 0; 02647 virtual float BSAPI_METHOD GetConfidence() = 0; 02648 virtual void BSAPI_METHOD SetScore(float score) = 0; 02649 virtual void BSAPI_METHOD SetConfidence(float confidence) = 0; 02650 virtual void BSAPI_METHOD SetData(void *pData) = 0; 02651 virtual void * BSAPI_METHOD GetData() = 0; 02652 virtual void BSAPI_METHOD SetWordPenalty(float wordPenalty) = 0; 02653 virtual void BSAPI_METHOD SetModelPenalty(float modelPenalty) = 0; 02654 virtual void BSAPI_METHOD SetLMScale(float lMScale) = 0; 02655 02656 02657 }; 02658 02666 class STransFSTI : public STranscriptionI 02667 { 02668 public: 02669 virtual void * BSAPI_METHOD GetFST() = 0; 02670 virtual bool BSAPI_METHOD SetFST(void *pFST) = 0; 02671 virtual STransFSTExtensionI * BSAPI_METHOD GetExtension() = 0; 02672 virtual void BSAPI_METHOD SetExtension(STransFSTExtensionI *pExtension) = 0; 02673 }; 02674 02678 class STransFSTExtensionI : public SUnknownI 02679 { 02680 public: 02681 virtual bool BSAPI_METHOD InitStr(int nNodes, int nArcs, const char *pFlags) = 0; 02682 virtual bool BSAPI_METHOD ReInitStr(const char *pFlags) = 0; 02683 virtual bool BSAPI_METHOD Init(int nNodes, int nArcs, unsigned int flags) = 0; 02684 virtual bool BSAPI_METHOD ReInit(unsigned int flags) = 0; 02685 virtual unsigned int BSAPI_METHOD GetFlags() = 0; 02686 virtual int BSAPI_METHOD GetNNodes() = 0; 02687 virtual int BSAPI_METHOD GetNArcs() = 0; 02688 virtual long_long * BSAPI_METHOD GetStarts() = 0; 02689 virtual long_long * BSAPI_METHOD GetEnds() = 0; 02690 virtual float * BSAPI_METHOD GetPosteriors() = 0; 02691 virtual float * BSAPI_METHOD GetLanguageLikes() = 0; 02692 virtual float * BSAPI_METHOD GetAcousticLikes() = 0; 02693 virtual float * BSAPI_METHOD GetAlphas() = 0; 02694 virtual float * BSAPI_METHOD GetBetas() = 0; 02695 }; 02696 02699 class SSTKLatticeToFSTConvertorI : public SUnknownI, public STransCallbackI 02700 { 02701 public: 02702 virtual void BSAPI_METHOD SetTarget(STransCallbackI *pTarget) = 0; 02703 virtual void BSAPI_METHOD SetAddExtension(bool addExtension = false) = 0; 02704 virtual void BSAPI_METHOD SetExtensionFlags(const char *pExtensionFlags = "start_time end_time") = 0; 02705 virtual void BSAPI_METHOD SetAddTimesToOutputSymbols(bool addTimesToOutputSymbols) = 0; 02706 virtual void BSAPI_METHOD SetLanguageModelScale(float languageModelScale) = 0; 02707 virtual void BSAPI_METHOD SetAcousticModelScale(float acousticModelScale) = 0; 02708 virtual void BSAPI_METHOD SetWordInsertionPenalty(float wordInsertionPenalty) = 0; 02709 }; 02710 02713 class SFSTToConfusionNetworkConvertorI : public SUnknownI, public STransCallbackI 02714 { 02715 public: 02716 virtual void BSAPI_METHOD SetLanguageModelScale(float languageModelScale = 31.0f) = 0; 02717 virtual void BSAPI_METHOD SetAcousticModelScale(float acousticModelScale = 1.0f) = 0; 02718 virtual void BSAPI_METHOD SetWordInsertionPenalty(float wordInsertionPenalty = -20.0f) = 0; 02719 virtual void BSAPI_METHOD SetMaxParallelWords(int maxParallelWords = 0) = 0; 02720 virtual void BSAPI_METHOD SetMinWordLogPosteriorProbability(float minWordLogPosteriorProbability = -70.0f) = 0; 02721 virtual void BSAPI_METHOD SetTarget(STransCallbackI *pTarget) = 0; 02722 }; 02723 02726 class STransPosteriorsI : public STranscriptionI 02727 { 02728 public: 02729 virtual void BSAPI_METHOD First() = 0; 02730 virtual bool BSAPI_METHOD Get(char **ppRetLabel, float *pRetPosterior) = 0; 02731 virtual void BSAPI_METHOD Clear() = 0; 02732 virtual bool BSAPI_METHOD Add(char *pLabel, float posterior) = 0; 02733 virtual void BSAPI_METHOD Sort() = 0; 02734 virtual void BSAPI_METHOD SetUseOnlyPointers(bool useOnlyPointers) = 0; 02735 }; 02736 02739 class STransSegmentationArrayI : public STranscriptionI 02740 { 02741 public: 02742 virtual void BSAPI_METHOD SetArray(segm_pos_type *pArray, int length = 0) = 0; // the object frees the array when it is destroyed 02743 virtual segm_pos_type * BSAPI_METHOD GetArray(int *pLength = 0) = 0; 02744 }; 02745 02748 class SParametersI : public SUnknownI 02749 { 02750 public: 02751 virtual bool BSAPI_METHOD Assign(SParametersI *pSource) = 0; 02752 02753 virtual int BSAPI_METHOD GetChannel() = 0; 02754 virtual bool BSAPI_METHOD GetIsLast() = 0; 02755 virtual bool BSAPI_METHOD GetIsValid() = 0; 02756 02757 virtual void BSAPI_METHOD SetChannel(int channel) = 0; 02758 virtual void BSAPI_METHOD SetIsLast(bool last) = 0; 02759 virtual void BSAPI_METHOD SetIsValid(bool valid) = 0; 02760 }; 02761 02764 class SParamCmllrI : public SParametersI 02765 { 02766 public: 02767 virtual SFloatMatrixI * BSAPI_METHOD GetMatrix() = 0; 02768 virtual bool BSAPI_METHOD SetMatrix(SFloatMatrixI *pMatrix) = 0; 02769 }; 02770 02774 class SParamIVectorI : public SParametersI 02775 { 02776 public: 02780 virtual float * BSAPI_METHOD GetIVector() = 0; 02784 virtual int BSAPI_METHOD GetLength() = 0; 02790 virtual bool BSAPI_METHOD SetIVector(float *pIvector, int length) = 0; 02795 virtual int BSAPI_METHOD GetNFrames() = 0; 02799 virtual void BSAPI_METHOD SetNFrames(int nFrames) = 0; 02800 }; 02801 02804 class SParamIndexClusterI : public SParametersI 02805 { 02806 public: 02811 virtual int * BSAPI_METHOD GetIndexes(int *pLength = 0) = 0; 02817 virtual bool BSAPI_METHOD SetIndexes(int *pIndexes, int length) = 0; 02818 }; 02819 02822 class SParamNormI : public SParametersI 02823 { 02824 public: 02825 virtual int BSAPI_METHOD GetVectorSize() = 0; 02826 virtual float * BSAPI_METHOD GetMeans(int *pLength = 0) = 0; 02827 virtual float * BSAPI_METHOD GetInvVariances(int *pLength = 0) = 0; 02828 virtual float * BSAPI_METHOD GetGlobVariances(int *pLength = 0) = 0; 02829 virtual void BSAPI_METHOD PrintMeans()=0; 02830 virtual void BSAPI_METHOD PrintInvStds()=0; 02831 virtual void BSAPI_METHOD PrintGlobStds()=0; 02832 virtual bool BSAPI_METHOD SetMeans(float *pMeans, int length) = 0; 02833 virtual bool BSAPI_METHOD SetInvVariances(float *pInvVariances, int length) = 0; 02834 virtual bool BSAPI_METHOD SetGlobVariances(float *pGlobVariances, int length) = 0; 02835 }; 02836 02839 class SParamGMMEstimI : public SParametersI 02840 { 02841 public: 02842 virtual long_long BSAPI_METHOD GetTime() = 0; 02843 virtual float BSAPI_METHOD GetFactor() = 0; 02844 virtual int BSAPI_METHOD GetBestClass() = 0; 02845 virtual char ** BSAPI_METHOD GetClassNames(int *pNValues = 0) = 0; 02846 virtual float * BSAPI_METHOD GetClassScores(int *pNValues = 0) = 0; 02847 02848 virtual void BSAPI_METHOD SetTime(long_long timeHTK) = 0; 02849 virtual void BSAPI_METHOD SetFactor(float factor) = 0; 02850 virtual void BSAPI_METHOD SetBestClass(int bestClass) = 0; 02851 virtual bool BSAPI_METHOD SetClassNames(char **ppClassNames, int nValues) = 0; 02852 virtual bool BSAPI_METHOD SetClassScores(float *pClassScores, int nValues) = 0; 02853 }; 02854 02857 class SStatisticsI : public SUnknownI 02858 { 02859 public: 02860 virtual bool BSAPI_METHOD Assign(SStatisticsI *pSource) = 0; 02861 02862 virtual int BSAPI_METHOD GetChannel() = 0; 02863 virtual bool BSAPI_METHOD GetIsLast() = 0; 02864 virtual bool BSAPI_METHOD GetIsValid() = 0; 02865 02866 virtual void BSAPI_METHOD SetChannel(int channel) = 0; 02867 virtual void BSAPI_METHOD SetIsLast(bool last) = 0; 02868 virtual void BSAPI_METHOD SetIsValid(bool valid) = 0; 02869 }; 02870 02873 class SStatsCmllrI : public SStatisticsI 02874 { 02875 public: 02876 virtual SFloatMatrixI * BSAPI_METHOD GetMeans() = 0; 02877 virtual SFloatMatrixI * BSAPI_METHOD GetCovariances() = 0; 02878 virtual float BSAPI_METHOD GetOccupation() = 0; 02879 02880 virtual bool BSAPI_METHOD SetMeans(SFloatMatrixI *pMeans) = 0; 02881 virtual bool BSAPI_METHOD SetCovariances(SFloatMatrixI *pCovariances) = 0; 02882 virtual void BSAPI_METHOD SetOccupation(float occupation) = 0; 02883 }; 02884 02887 class SStatsGMMI : public SStatisticsI 02888 { 02889 public: 02890 virtual float * BSAPI_METHOD GetZeroOrderStats() = 0; 02891 virtual float * BSAPI_METHOD GetFirstOrderStats() = 0; 02892 virtual float * BSAPI_METHOD GetSecondOrderStats() = 0; 02893 virtual int BSAPI_METHOD GetNMixtures() = 0; 02894 virtual int BSAPI_METHOD GetVectorSize() = 0; 02895 virtual void BSAPI_METHOD SetNMixtures(int nMixtures = 1) = 0; 02896 virtual void BSAPI_METHOD SetVectorSize(int vectorSize = 1) = 0; 02897 virtual void BSAPI_METHOD SetAllocSecondOrderStats(bool allocSecondOrderStats = false) = 0; 02898 virtual void BSAPI_METHOD SetModel(SUnknownI *pModel = 0) = 0; 02899 virtual SUnknownI * BSAPI_METHOD GetModel() = 0; 02900 }; 02901 02909 class SParametersSplitterI : public SUnknownI, public SParametersCallbackI 02910 { 02911 public: 02912 02921 virtual bool BSAPI_METHOD SetTarget(int index, SParametersCallbackI *pTarget) = 0; 02922 02929 virtual bool BSAPI_METHOD AddTarget(SParametersCallbackI *pTarget) = 0; 02930 }; 02931 02939 class STranscriptionSplitterI : public SUnknownI, public STransCallbackI 02940 { 02941 public: 02942 02951 virtual bool BSAPI_METHOD SetTarget(int index, STransCallbackI *pTarget) = 0; 02952 02959 virtual bool BSAPI_METHOD AddTarget(STransCallbackI *pTarget) = 0; 02960 02961 virtual bool BSAPI_METHOD SetMode(const char *pMode) = 0; 02962 }; 02963 02966 class STranscriptionDistributerI : public SUnknownI, public STransCallbackI 02967 { 02968 public: 02969 virtual void BSAPI_METHOD SetOneWordTarget(STransCallbackI *pTarget) = 0; 02970 virtual void BSAPI_METHOD SetOneBestTarget(STransCallbackI *pTarget) = 0; 02971 virtual void BSAPI_METHOD SetLatticeTarget(STransCallbackI *pTarget) = 0; 02972 virtual void BSAPI_METHOD SetFSTTarget(STransCallbackI *pTarget) = 0; 02973 virtual void BSAPI_METHOD SetPosteriorsTarget(STransCallbackI *pTarget) = 0; 02974 virtual void BSAPI_METHOD SetSegmentationArrayTarget(STransCallbackI *pTarget) = 0; 02975 }; 02976 02979 class SSegmentationI : public SUnknownI, public SWaveformSourceCallbackI 02980 { 02981 public: 02982 virtual void BSAPI_METHOD SetTarget(STransCallbackI *pTarget) = 0; 02983 }; 02984 02987 class SLabelMapperI : public SUnknownI, public STransCallbackI 02988 { 02989 public: 02990 virtual void BSAPI_METHOD ClearRules() = 0; 02991 virtual bool BSAPI_METHOD AddRule(const char *pRule) = 0; 02992 virtual bool BSAPI_METHOD SetRules(const char *pRules) = 0; 02993 virtual bool BSAPI_METHOD LoadRules(const char *pFilename) = 0; // bs:include bs:only_if_set 02994 virtual void BSAPI_METHOD SetSimpleOneToOneMapping(bool simple = false) = 0; 02995 virtual void BSAPI_METHOD SetTarget(STransCallbackI *pTarget) = 0; 02996 }; 02997 03000 class SLabelAdjusterI : public SUnknownI, public STransCallbackI 03001 { 03002 public: 03003 virtual void BSAPI_METHOD ClearAdjustments() = 0; 03004 virtual bool BSAPI_METHOD AddAdjustment(const char *pLabel, long_long startAdjustment, long_long endAdjustment) = 0; 03005 virtual bool BSAPI_METHOD SetAdjustments(const char *pAdjustments) = 0; 03006 03007 virtual void BSAPI_METHOD Restart() = 0; 03008 03009 virtual void BSAPI_METHOD SetTarget(STransCallbackI *pTarget) = 0; 03010 virtual void BSAPI_METHOD SetHistoryLength(int historyLength = 5) = 0; 03011 }; 03012 03015 class SLabelClustererI : public SUnknownI, public STransCallbackI 03016 { 03017 public: 03018 virtual void BSAPI_METHOD SetMinLengthMs(int minLengthMs = 30000) = 0; 03019 virtual void BSAPI_METHOD SetMaxLengthMs(int maxLengthMs = 60000) = 0; 03020 virtual void BSAPI_METHOD SetLabel(const char *pLabel = "voice") = 0; 03021 03022 virtual void BSAPI_METHOD Restart() = 0; 03023 03024 virtual void BSAPI_METHOD SetTarget(STransCallbackI *pTarget) = 0; 03025 }; 03026 03027 03030 class STranscriptionJointerI : public SUnknownI, public STransCallbackI 03031 { 03032 public: 03033 virtual void BSAPI_METHOD Reset() = 0; 03034 virtual void BSAPI_METHOD SetTarget(STransCallbackI *pTarget) = 0; 03035 }; 03036 03039 class STranscriptionCharsetConvertorI : public SUnknownI, public STransCallbackI 03040 { 03041 public: 03042 virtual bool BSAPI_METHOD LoadInternalCharsetTable(const char *pFile) = 0; // bs:include bs:only_if_set 03043 virtual bool BSAPI_METHOD LoadExternalCharsetTable(const char *pFile) = 0; // bs:include bs:only_if_set 03044 virtual void BSAPI_METHOD SetTarget(STransCallbackI *pTarget) = 0; 03045 }; 03046 03049 class SCalibrationI : public SUnknownI, public STransCallbackI 03050 { 03051 public: 03052 virtual bool BSAPI_METHOD Load(const char *pFileName) = 0; 03053 virtual void BSAPI_METHOD SetTarget(STransCallbackI *pTarget) = 0; 03054 }; 03055 03058 class SPhonemeBasedCalibrationI : public SCalibrationI 03059 { 03060 public: 03061 virtual void BSAPI_METHOD SetPhnTrans(SPhnTransI *pPhnTrans) = 0; 03062 virtual void BSAPI_METHOD SetGlobalShift(float globalShift) = 0; 03063 virtual void BSAPI_METHOD SetGlobalScale(float globalScale) = 0; 03064 virtual bool BSAPI_METHOD SetPhonemeShift(const char *pPhoneme, float shift) = 0; 03065 virtual void BSAPI_METHOD SetConvertToPosterior(bool convert2posterior) = 0; 03066 }; 03067 03068 03071 class SPhonotacticModelsI : public SUnknownI, public STransCallbackI 03072 { 03073 public: 03074 virtual bool BSAPI_METHOD Init(const char *pConfigFile) = 0; 03075 03076 virtual int BSAPI_METHOD GetNRequestedTrainingIters() = 0; 03077 virtual bool BSAPI_METHOD StartTrainingIteration() = 0; 03078 virtual bool BSAPI_METHOD StartSentence(const char *pModelName, const char *pFileName = 0) = 0; 03079 virtual bool BSAPI_METHOD FinishTraining() = 0; 03080 03081 virtual bool BSAPI_METHOD StartScoring(const char *pFileName) = 0; 03082 virtual float * BSAPI_METHOD GetModelScores(int *pNumValues) = 0; 03083 virtual char ** BSAPI_METHOD GetModelNames(int *pNumValues) = 0; 03084 03085 virtual bool BSAPI_METHOD Cancel() = 0; 03086 03087 virtual bool BSAPI_METHOD LoadTemporalFile(bool *pSuccess) = 0; // can be called right after 'StartSentence' or 'StartScoring' instead of sending data 03088 virtual bool BSAPI_METHOD SaveTemporalFile(bool overwrite = true) = 0; 03089 03090 virtual void BSAPI_METHOD SetModelDirectory(const char *pModelDirectory) = 0; 03091 virtual bool BSAPI_METHOD ActivateModels(const char *pList) = 0; 03092 virtual bool BSAPI_METHOD BackupModels() = 0; 03093 virtual bool BSAPI_METHOD RestoreModels() = 0; 03094 03095 virtual bool BSAPI_METHOD RemoveModel(const char *pName) = 0; 03096 virtual bool BSAPI_METHOD RenameModel(const char *pOldName, const char *pNewName) = 0; 03097 }; 03098 03101 class SNGramPhonotacticModelsI : public SPhonotacticModelsI 03102 { 03103 }; 03104 03107 class SConfigureI : public SUnknownI 03108 { 03109 public: 03110 virtual void BSAPI_METHOD Clear() = 0; 03111 03112 virtual void BSAPI_METHOD SetVariableTable(config_var_type *pTable) = 0; 03113 virtual void BSAPI_METHOD SetCheckUnknownVariables(bool v) = 0; 03114 virtual void BSAPI_METHOD SetConfigLineChecker(SConfigureCallbackI *pConfigLineChecker) = 0; 03115 virtual bool BSAPI_METHOD Load(const char *pFile) = 0; 03116 virtual bool BSAPI_METHOD Save(const char *pFile = 0) = 0; 03117 virtual void BSAPI_METHOD SubstValues(const char *pPattern, const char *pNewValue) = 0; 03118 03119 virtual void BSAPI_METHOD FirstSection() = 0; 03120 virtual char * BSAPI_METHOD GetSection() = 0; 03121 virtual void BSAPI_METHOD FirstVariable(const char *pSection) = 0; 03122 virtual char * BSAPI_METHOD GetVariable() = 0; 03123 03124 virtual void BSAPI_METHOD SetString(const char *pSection, const char *pVariable, const char *pValue) = 0; 03125 virtual void BSAPI_METHOD SetBool(const char *pSection, const char *pVariable, bool pValue) = 0; 03126 virtual void BSAPI_METHOD SetInt(const char *pSsection, const char *pVariable, int pValue) = 0; 03127 virtual void BSAPI_METHOD SetFloat(const char *pSsection, const char *pVariable, float pValue) = 0; 03128 03129 virtual char * BSAPI_METHOD GetString(const char *pSection, const char *pVariable) = 0; 03130 virtual bool BSAPI_METHOD GetBool(const char *pSection, const char *pVariable) = 0; 03131 virtual int BSAPI_METHOD GetInt(const char *pSsection, const char *pVariable) = 0; 03132 virtual float BSAPI_METHOD GetFloat(const char *pSsection, const char *pVariable) = 0; 03133 }; 03134 03137 class SFileWaveformPlayerI : public SUnknownI 03138 { 03139 public: 03146 virtual bool BSAPI_METHOD SetFormat(SWaveformSourceCallbackI::wave_format_type waveformFormat, int sampleFreq, int nChannels) = 0; 03147 03154 virtual bool BSAPI_METHOD SetFormatStr(const char *pWaveformFormat, int sampleFreq, int nChannels) = 0; 03155 03162 virtual bool BSAPI_METHOD Play(const char *pFile, bool wait = false) = 0; 03163 03170 virtual bool BSAPI_METHOD PlayOrUnpause(const char *pFile) = 0; 03171 03176 virtual void BSAPI_METHOD Pause(bool pause = true) = 0; 03177 03181 virtual void BSAPI_METHOD PauseOrUnpause() = 0; 03182 03185 virtual void BSAPI_METHOD Stop() = 0; 03186 }; 03187 03190 class SWaveformTargetI : public SUnknownI, public SWaveformSourceCallbackI 03191 { 03192 public: 03193 virtual void BSAPI_METHOD Stop() = 0; 03194 virtual void BSAPI_METHOD Pause() = 0; 03195 virtual void BSAPI_METHOD Restart() = 0; 03196 }; 03197 03200 class SAudioWaveformTargetI : public SWaveformTargetI 03201 { 03202 public: 03203 virtual bool BSAPI_METHOD SetDevice(const char *pDevice = "default") = 0; 03204 virtual bool BSAPI_METHOD SetFormat(int sampleFreq, int nChannels, int nBitsPerSample) = 0; 03205 virtual void BSAPI_METHOD SetWaitUntilWritten(bool waitUntilWritten = false) = 0; 03206 virtual bool BSAPI_METHOD GetIsWritten() = 0; 03207 virtual double BSAPI_METHOD GetPosition() = 0; 03208 03209 virtual bool BSAPI_METHOD Open() = 0; 03210 virtual void BSAPI_METHOD Close() = 0; 03211 virtual bool BSAPI_METHOD Write(void *pData, int nBytes) = 0; 03212 }; 03213 03216 class SWaveformSourceI : public SUnknownI 03217 { 03218 public: 03219 virtual bool BSAPI_METHOD Start() = 0; 03220 virtual void BSAPI_METHOD Stop() = 0; 03221 virtual void BSAPI_METHOD SetTarget(SWaveformSourceCallbackI *pTarget) = 0; 03222 }; 03223 03226 class SAudioWaveformSourceI : public SWaveformSourceI 03227 { 03228 public: 03229 virtual void BSAPI_METHOD SetOutBufferLenMs(float outBufferLenMs = 50) = 0; 03230 03231 virtual bool BSAPI_METHOD SetDevice(const char *pDevice = "default") = 0; 03232 virtual bool BSAPI_METHOD SetSampleFreq(int sampleFreq = 16000) = 0; 03233 virtual bool BSAPI_METHOD SetNChannels(int nChannels = 1) = 0; 03234 virtual bool BSAPI_METHOD SetNBitsPerSample(int nBitsPerSample = 16) = 0; 03235 virtual void BSAPI_METHOD SetUseOwnThread(bool useOwnThread = true) = 0; 03236 03237 virtual bool BSAPI_METHOD Open() = 0; 03238 virtual void BSAPI_METHOD Close() = 0; 03239 virtual bool BSAPI_METHOD Read(char *pBuff, int len) = 0; 03240 }; 03241 03244 class SFileWaveformSourceI : public SWaveformSourceI 03245 { 03246 public: 03247 virtual bool BSAPI_METHOD ProcessFile(const char *pLine) = 0; 03248 virtual void BSAPI_METHOD ClearBuffers() = 0; 03249 virtual void BSAPI_METHOD SetMaxBufferLengthBytes(int len = 0) = 0; 03250 virtual void BSAPI_METHOD SetMaxBufferLengthSeconds(float len = 0.0f) = 0; 03251 virtual void BSAPI_METHOD SetWaveformFormatConvertor(SWaveformFormatConvertorI * pConvertor) = 0; 03252 virtual void BSAPI_METHOD SetLastFrameFlagForAllBuffers(bool lastFrameFlagForAllBuffers = false) = 0; 03253 virtual void BSAPI_METHOD SetSendOnlyFirstBuffer(bool sendOnlyFirstBuffer = false) = 0; 03254 virtual void BSAPI_METHOD SetDataStartMul(double dataStartMul = 1.0) = 0; 03255 virtual void BSAPI_METHOD SetDataStartShift(long_long dataStartShift = 0) = 0; 03256 virtual void BSAPI_METHOD SetDataEndMul(double dataEndMul = 1.0) = 0; 03257 virtual void BSAPI_METHOD SetDataEndShift(long_long dataEndShift = 0) = 0; 03258 }; 03259 03276 class SRiffFileI : public SUnknownI 03277 { 03278 public: 03279 // NOTE: write and jumpToEnd flags are not implemented yet 03280 virtual bool BSAPI_METHOD Open(const char *pFile, bool write = false, bool newFile = true, bool jumpToEnd = false) = 0; 03281 virtual bool BSAPI_METHOD Close() = 0; 03282 virtual bool BSAPI_METHOD Rewind() = 0; 03283 03284 virtual char * BSAPI_METHOD GetFormatId() = 0; 03285 virtual bool BSAPI_METHOD Eof() = 0; 03286 virtual bool BSAPI_METHOD Eol() = 0; 03287 03288 // pChunkId and pListName must be 5 bytes long 03289 virtual bool BSAPI_METHOD ReadChunkHeader(char *pChunkId = 0, unsigned int *pChunkLength = 0, char *pListName = 0) = 0; 03290 virtual bool BSAPI_METHOD ReadChunkData(void *pData, int requestedLength = 0) = 0; 03291 03292 virtual bool BSAPI_METHOD SkipChunk() = 0; 03293 virtual bool BSAPI_METHOD FindChunk(const char *pChunkId, const char *pListName, bool *pFound = 0, unsigned int *pLength = 0) = 0; 03294 03295 // NOTE: not implemented yet 03296 virtual bool BSAPI_METHOD WriteChunk(const char *pChunkId, const char *pData, unsigned int length) = 0; 03297 03298 virtual bool BSAPI_METHOD OpenList() = 0; 03299 virtual bool BSAPI_METHOD CreateList(const char *pName) = 0; 03300 virtual bool BSAPI_METHOD CloseList() = 0; 03301 03302 virtual bool BSAPI_METHOD DumpFileStructure() = 0; 03303 }; 03304 03307 class SAudioFileI : public SUnknownI 03308 { 03309 public: 03310 virtual bool BSAPI_METHOD DetectFormat(const char *pHeader, int length) = 0; // returns true if the class can process the format 03311 03312 virtual bool BSAPI_METHOD Open(const char *pFile, bool write = false, bool newFile = true, bool jumpToEnd = false) = 0; 03313 virtual bool BSAPI_METHOD Close() = 0; 03314 03315 virtual bool BSAPI_METHOD Read(void *pBuffer, int requestedLength = 0) = 0; 03316 virtual bool BSAPI_METHOD Write(void *pBuffer, int length) = 0; 03317 03318 virtual int BSAPI_METHOD GetDataLength() = 0; 03319 virtual int BSAPI_METHOD GetNSamples() = 0; 03320 virtual bool BSAPI_METHOD GetCanGrow() = 0; 03321 03322 virtual SWaveformSourceCallbackI::wave_format_type BSAPI_METHOD GetFormat() = 0; 03323 virtual int BSAPI_METHOD GetSampleFreq() = 0; 03324 virtual int BSAPI_METHOD GetNChannels() = 0; 03325 03326 virtual void BSAPI_METHOD SetNSamples(int nSamples) = 0; 03327 03328 virtual void BSAPI_METHOD SetFormat(SWaveformSourceCallbackI::wave_format_type format) = 0; 03329 virtual void BSAPI_METHOD SetSampleFreq(int sampleFreq) = 0; 03330 virtual void BSAPI_METHOD SetNChannels(int nChannels) = 0; 03331 }; 03332 03335 class SRawFileI : public SAudioFileI 03336 { 03337 }; 03338 03341 class SWaveFileI : public SAudioFileI 03342 { 03343 public: 03344 virtual SRiffFileI *BSAPI_METHOD GetRiffFile() = 0; 03345 virtual void BSAPI_METHOD DumpFormat() = 0; 03346 }; 03347 03355 class SWaveformSplitterI : public SUnknownI, public SWaveformSourceCallbackI 03356 { 03357 public: 03358 03367 virtual bool BSAPI_METHOD SetTarget(int index, SWaveformSourceCallbackI *pTarget) = 0; 03368 03375 virtual bool BSAPI_METHOD AddTarget(SWaveformSourceCallbackI *pTarget) = 0; 03376 }; 03377 03380 class SWaveformFormatConvertorI : public SUnknownI, public SWaveformSourceCallbackI 03381 { 03382 public: 03383 virtual void BSAPI_METHOD SetTarget(SWaveformSourceCallbackI *pTarget) = 0; 03384 03385 virtual bool BSAPI_METHOD SetInputFormatStr(const char *pInputFormat = "lin16") = 0; 03386 virtual bool BSAPI_METHOD SetInputFormat(wave_format_type inputFormat) = 0; 03387 virtual bool BSAPI_METHOD SetOutputFormatStr(const char *pOuptutFormat = "float") = 0; 03388 virtual bool BSAPI_METHOD SetOutputFormat(wave_format_type outputFormat) = 0; 03389 virtual void BSAPI_METHOD SetNChannels(int nChannels = 1) = 0; 03390 virtual void BSAPI_METHOD SetConcatenateChannels(bool concatenate = true) = 0; 03391 virtual void BSAPI_METHOD SetSampleFreq(int sampleFreq = 8000) = 0; 03392 03393 virtual void BSAPI_METHOD SetWaveDcShift(float waveDCShift = 0.0f) = 0; 03394 virtual void BSAPI_METHOD SetWaveScale(float waveScale = 1.0f) = 0; 03395 virtual void BSAPI_METHOD SetWaveNoiseLevel(float waveNoiseLevel = 0.0f) = 0; 03396 03397 virtual void BSAPI_METHOD SetWaveNoiseSeed(unsigned int waveNoiseSeed = 999) = 0; // 0 means not used 03398 03399 virtual wave_format_type BSAPI_METHOD GetInputFormat() = 0; 03400 virtual wave_format_type BSAPI_METHOD GetOutputFormat() = 0; 03401 virtual int BSAPI_METHOD GetNChannels() = 0; 03402 virtual int BSAPI_METHOD GetSampleFreq() = 0; 03403 virtual float BSAPI_METHOD GetInputLength() = 0; 03404 virtual wave_format_type BSAPI_METHOD Str2WaveFormat(const char *pStr) = 0; 03405 virtual const char * BSAPI_METHOD WaveFormat2Str(wave_format_type format) = 0; 03406 }; 03407 03411 class SChannelSplitterI : public SUnknownI, public SWaveformSourceCallbackI 03412 { 03413 public: 03421 virtual void BSAPI_METHOD SetTarget(SWaveformSourceCallbackI *pTarget) = 0; 03422 03430 virtual bool BSAPI_METHOD SetPerChannelTarget(int channel, SWaveformSourceCallbackI *pTarget) = 0; 03431 03437 virtual void BSAPI_METHOD SetChannelTarget(SChannelCallbackI *pChannelTarget) = 0; 03438 03445 virtual void BSAPI_METHOD SetNChannels(int nChannels = 1) = 0; 03446 03454 virtual int BSAPI_METHOD GetActualChannel() = 0; 03455 03461 virtual int BSAPI_METHOD GetActualNChannels() = 0; 03462 }; 03463 03467 class SChannelSetterI : public SUnknownI, public SChannelCallbackI, public STransCallbackI 03468 { 03469 public: 03475 virtual void BSAPI_METHOD SetTarget(STransCallbackI *pTarget) = 0; 03476 }; 03477 03480 class SWaveformI : public SUnknownI 03481 { 03482 public: 03483 virtual void * BSAPI_METHOD GetWaveform(int *pNBytes = 0) = 0; 03484 virtual SWaveformSourceCallbackI::wave_format_type BSAPI_METHOD GetFormat() = 0; 03485 virtual int BSAPI_METHOD GetSampleFreq() = 0; 03486 virtual int BSAPI_METHOD GetNChannels() = 0; 03487 03488 virtual bool BSAPI_METHOD SetWaveform(const void *pData, int nBytes) = 0; 03489 virtual void BSAPI_METHOD SetFormat(SWaveformSourceCallbackI::wave_format_type format) = 0; 03490 virtual bool BSAPI_METHOD SetFormatStr(const char *pFormatStr) = 0; 03491 virtual void BSAPI_METHOD SetSampleFreq(int sampleFreq) = 0; 03492 virtual void BSAPI_METHOD SetNChannels(int nChannels) = 0; 03493 }; 03494 03498 class SWaveformMemoryI : public SUnknownI, public SWaveformSourceCallbackI 03499 { 03500 public: 03501 virtual float * BSAPI_METHOD GetWaveform(int *pLength = 0) = 0; 03502 virtual void BSAPI_METHOD Clear() = 0; 03503 virtual int BSAPI_METHOD GetSampleFreq() = 0; 03504 virtual int BSAPI_METHOD GetNChannels() = 0; 03505 virtual void BSAPI_METHOD SetUseWaveformReference(bool useWaveformReference = false) = 0; 03506 virtual void BSAPI_METHOD SetTarget(SWaveformSourceCallbackI *pTarget) = 0; 03507 virtual SWaveformSourceCallbackI * BSAPI_METHOD GetTarget() = 0; 03508 virtual bool BSAPI_METHOD Send() = 0; 03509 03510 }; 03511 03516 class SWaveformResamplerI : public SUnknownI, public SWaveformSourceCallbackI 03517 { 03518 public: 03519 03524 virtual void BSAPI_METHOD SetTargetSampleFreq(int targetSampleFreq = 8000) = 0; 03525 virtual int BSAPI_METHOD GetTargetSampleFreq() = 0; 03526 03531 virtual void BSAPI_METHOD SetTarget(SWaveformSourceCallbackI *pTarget) = 0; 03532 virtual SWaveformSourceCallbackI * BSAPI_METHOD GetTarget() = 0; 03533 03540 virtual void BSAPI_METHOD SetOutBatchSize(int outBatchSize = 160) = 0; 03541 virtual int BSAPI_METHOD GetOutBatchSize() = 0; 03542 03543 virtual void BSAPI_METHOD SetMaxFrequencyDeflection(float frequencyDeflection = 0.0f) = 0; 03544 }; 03545 03546 03549 class SWaveformSegmenterI : public SUnknownI, public SWaveformSourceCallbackI, public STransCallbackI 03550 { 03551 public: 03556 virtual void BSAPI_METHOD SetSegmentStartExtensionMs(int segmentStartExtensionMs = 0) = 0; 03557 03562 virtual void BSAPI_METHOD SetSegmentEndExtensionMs(int segmentEndExtensionMs = 0) = 0; 03563 03574 virtual void BSAPI_METHOD SetUseNeighbouringWaveform(bool useNeighbouringWaveform = true) = 0; 03575 03579 virtual void BSAPI_METHOD SetWaitForWholeSentence(bool waitForWholeSentence = false) = 0; 03580 03585 virtual void BSAPI_METHOD SetMinimumSegmentLength(int minSegmentLengthMs = 0) = 0; 03586 03592 virtual void BSAPI_METHOD SetSpeechLabel(const char *pSpeechLabel = "voice") = 0; 03593 03598 virtual void BSAPI_METHOD SetTarget(SWaveformSourceCallbackI *pTarget) = 0; 03599 }; 03600 03603 class SOnlineWaveformSegmenterI : public SUnknownI, public SWaveformSourceCallbackI, public STransCallbackI 03604 { 03605 public: 03606 03610 virtual void BSAPI_METHOD SetOutBatchSize(int outBatchSize = 0) = 0; 03611 03617 virtual void BSAPI_METHOD SetSpeechLabel(const char *pSpeechLabel = "voice") = 0; 03618 03623 virtual void BSAPI_METHOD SetTarget(SWaveformSourceCallbackI *pTarget) = 0; 03624 }; 03625 03633 class SWaveformResegmenterI : public SUnknownI, public SWaveformSourceCallbackI, public STransCallbackI 03634 { 03635 public: 03636 virtual void BSAPI_METHOD SetWindowLengthMs(float windowLengthMs = 25.0f) = 0; 03637 virtual void BSAPI_METHOD SetStepMs(float stepMs = 10.0f) = 0; 03638 virtual void BSAPI_METHOD SetStartSegmentExtensionMs(float startSegmentExtension = 0.0f) = 0; 03639 virtual void BSAPI_METHOD SetEndSegmentExtensionMs(float endSegmentExtension = 0.0f) = 0; 03640 virtual void BSAPI_METHOD SetUseWaveformReference(bool useWaveformReference = false) = 0; 03641 virtual void BSAPI_METHOD SetMaxNSegments(int maxNSegments = 0) = 0; 03642 virtual void BSAPI_METHOD SetTotalVoiceLengthSec(float totalVoiceLengthSec) = 0; 03643 virtual void BSAPI_METHOD SetWaveformTarget(SWaveformSourceCallbackI *pWaveformTarget) = 0; 03644 virtual void BSAPI_METHOD SetOriginalTranscriptionTarget(STransCallbackI *pOriginalTranscriptionTarget) = 0; 03645 virtual void BSAPI_METHOD SetNewTranscriptionTarget(STransCallbackI *pNewTranscriptionTarget) = 0; 03646 virtual void BSAPI_METHOD SetReleaseSegmWaveformAfterTransc(bool releaseSegmWaveformAfterTransc) = 0; 03647 }; 03648 03655 class SWaveformNodeI : public SUnknownI, public SWaveformSourceCallbackI 03656 { 03657 public: 03658 virtual void BSAPI_METHOD SetTarget(SWaveformSourceCallbackI *pTarget) = 0; 03659 }; 03660 03667 class SStatisticsNodeI : public SUnknownI, public SStatisticsCallbackI 03668 { 03669 public: 03670 virtual void BSAPI_METHOD SetTarget(SStatisticsCallbackI *pTarget) = 0; 03671 }; 03672 03679 class SParametersNodeI : public SUnknownI, public SParametersCallbackI 03680 { 03681 public: 03682 virtual SParametersCallbackI * BSAPI_METHOD GetTarget() = 0; 03683 virtual void BSAPI_METHOD SetTarget(SParametersCallbackI *pTarget) = 0; 03684 03685 }; 03686 03690 class SWaveformFilterI : public SUnknownI, public SWaveformSourceCallbackI 03691 { 03692 public: 03693 virtual void BSAPI_METHOD SetTarget(SWaveformSourceCallbackI *pTarget) = 0; 03694 virtual void BSAPI_METHOD SetTarget2(SWaveformSourceCallbackI *pTarget2) = 0; 03695 virtual void BSAPI_METHOD SetSegmentationTarget(STransCallbackI *pSegmentationTarget) = 0; 03696 virtual void BSAPI_METHOD SetSpeechLabel(const char *pSpeechLabel = "voice") = 0; 03697 virtual void BSAPI_METHOD SetNonSpeechLabel(const char *pNonSpeechLabel = "silense") = 0; 03698 03699 virtual void BSAPI_METHOD SetUseFilter(bool useFilter = true) = 0; 03700 virtual void BSAPI_METHOD SetUseSilenceFilter(bool enable = true) = 0; 03701 virtual void BSAPI_METHOD SetUseTechnicalSignalFilter(bool enable = true) = 0; 03702 virtual void BSAPI_METHOD SetUseIntermittentNoiseFilter(bool enable = true) = 0; 03703 03704 virtual void BSAPI_METHOD SetOutBatchSize(int outBatchSize = 0) = 0; 03705 virtual bool BSAPI_METHOD Done() = 0; 03706 03707 virtual int BSAPI_METHOD GetSampleFreq() = 0; 03708 virtual bool BSAPI_METHOD SetSampleFreq(int sampleFreq = 8000) = 0; 03709 03710 virtual float BSAPI_METHOD GetEnergyThreshold() = 0; 03711 virtual void BSAPI_METHOD SetEnergyThreshold(float energyThreshold = 100.0f) = 0; 03712 03713 virtual void BSAPI_METHOD SetToneHeight(float toneHeight = 3.5f) = 0; 03714 virtual void BSAPI_METHOD SetToneRatio(float toneRatio = 0.15f) = 0; 03715 virtual void BSAPI_METHOD SetToneEnergyThreshold(float toneEnergyThreshold = 500.0f) = 0; 03716 03717 virtual void BSAPI_METHOD SetNoiseMinFreq(int noiseMinFreq = 500) = 0; 03718 virtual void BSAPI_METHOD SetNoiseMaxFreq(int noiseMaxFreq = 3000) = 0; 03719 virtual void BSAPI_METHOD SetNoiseThrToMaxDiff(float noiseThrToMaxDiff = 2.0f) = 0; 03720 virtual void BSAPI_METHOD SetNoiseMarginMinRatioBelowThr(float noiseMarginMinRatioBelowThr = 0.25f) = 0; 03721 virtual void BSAPI_METHOD SetNoiseCenterMinRatioAboveThr(float noiseCenterMinRatioAboveThr = 0.80f) = 0; 03722 virtual void BSAPI_METHOD SetNoiseEnergyThreshold(float noiseEnergyThreshold = 500.0f) = 0; 03723 03724 virtual void BSAPI_METHOD SetIntermittentIntervalSec(float intermittentIntervalSec = 0.000625f) = 0; 03725 virtual void BSAPI_METHOD SetIntermittentTopRatioMul(float intermittentTopRatioMul = 3.5f) = 0; 03726 virtual void BSAPI_METHOD SetIntermittentTopRatioAdd(float intermittentTopRatioAdd = 300.0f) = 0; 03727 virtual void BSAPI_METHOD SetIntermittentBottomRatio(float intermittentBottomRatio = 1.0f) = 0; 03728 03729 // energy detector setting 03730 virtual bool BSAPI_METHOD SetEdetExtToRightSec(float edetExtToRightSec = 0.1f) = 0; 03731 virtual bool BSAPI_METHOD SetEdetExtToLeftSec(float edetExtToLeftSec = 0.1f) = 0; 03732 virtual bool BSAPI_METHOD SetEdetMaxFillInPauseSec(float edetMaxFillInPauseSec = 0) = 0; 03733 03734 // technical signal detector setting 03735 virtual bool BSAPI_METHOD SetTdetExtToRightSec(float tdetExtToRightSec = 0.015f) = 0; 03736 virtual bool BSAPI_METHOD SetTdetExtToLeftSec(float tdetExtToLeftSec = 0.015f) = 0; 03737 virtual bool BSAPI_METHOD SetTdetMaxFillInPauseSec(float maxFillInPauseSec = 0.015f) = 0; 03738 virtual bool BSAPI_METHOD SetTdetMinDetectionSec(float minDetectionSec = 0.075f) = 0; 03739 03740 virtual float BSAPI_METHOD GetInputLength() = 0; 03741 virtual float BSAPI_METHOD GetTotalFilteredLength() = 0; 03742 virtual float BSAPI_METHOD GetTotalFilteredRatio() = 0; 03743 virtual float BSAPI_METHOD GetSilenceLength() = 0; 03744 virtual float BSAPI_METHOD GetSilenceRatio() = 0; 03745 virtual float BSAPI_METHOD GetTechnicalSignalLength() = 0; 03746 virtual float BSAPI_METHOD GetTechnicalSignalRatio() = 0; 03747 virtual float BSAPI_METHOD GetIntermittentNoiseLength() = 0; 03748 virtual float BSAPI_METHOD GetIntermittentNoiseRatio() = 0; 03749 virtual float BSAPI_METHOD GetSNR() = 0; 03750 }; 03751 03755 class SActiveWaveformPartSelectorI : public SUnknownI, public SWaveformSourceCallbackI, public STransCallbackI 03756 { 03757 public: 03758 virtual void BSAPI_METHOD SetUseWaveformReference(bool useWaveformReference = false) = 0; 03759 virtual void BSAPI_METHOD SetSpeechLabel(const char *pSpeechLabel = "voice") = 0; 03760 virtual void BSAPI_METHOD SetNonSpeechLabel(const char *pNonSpeechLabel = "silense") = 0; 03761 virtual void BSAPI_METHOD SetVectorSize(int vectorSize = 200) = 0; 03762 virtual void BSAPI_METHOD SetEnabled(bool enabled = true) = 0; 03763 03764 virtual void BSAPI_METHOD SetSelectionStartSec(float selectionStartSec = 0.0f) = 0; 03765 virtual void BSAPI_METHOD SetSelectionLengthSec(float selectionLengthSec = 0.0f) = 0; 03766 virtual void BSAPI_METHOD SetSelectionExtToSilSec(float selectionExtToSilSec = 0.0f) = 0; 03767 03768 virtual void BSAPI_METHOD SetRandomSelectionMinLengthSec(float randomSelectionMinLengthSec = 0.0f) = 0; 03769 virtual void BSAPI_METHOD SetRandomSelectionMaxLengthSec(float randomSelectionMaxLengthSec = 0.0f) = 0; 03770 03771 virtual void BSAPI_METHOD SetWaveformTarget(SWaveformSourceCallbackI *pWaveformTarget) = 0; 03772 virtual void BSAPI_METHOD SetTranscriptionTarget(STransCallbackI *pTranscriptionTarget) = 0; 03773 }; 03774 03778 class SSegmentMapperI : public SUnknownI, public STransCallbackI 03779 { 03780 public: 03781 virtual void BSAPI_METHOD SetSpeechLabel(const char *pSpeechLabel = "voice") = 0; 03782 virtual void BSAPI_METHOD SetNonSpeechLabel(const char *pNonSpeechLabel = "silense") = 0; 03783 virtual void BSAPI_METHOD SetPerSegmentMapping(bool perSegmentMapping = false) = 0; 03784 virtual void BSAPI_METHOD SetOverSegmentsMapping(bool overSegmentsMapping = false) = 0; 03785 virtual void BSAPI_METHOD SetAllowSegmentsSpan(bool allowSegmentsSpan = false) = 0; 03786 virtual void BSAPI_METHOD SetInheritIsLast(bool inheritIsLast = false) = 0; 03787 virtual void BSAPI_METHOD ClearSegments() = 0; 03788 virtual bool BSAPI_METHOD AddSegments(segm_pos_type *pSegments, int nSegments = -1) = 0; 03789 virtual bool BSAPI_METHOD MapSegment(long_long *pStart, long_long *pEnd, bool *is_last) = 0; 03790 virtual void BSAPI_METHOD SetTarget(STransCallbackI *pTarget) = 0; 03791 }; 03792 03799 class SSpeechRecI : public SUnknownI 03800 { 03801 public: 03802 03803 // data format type 03804 typedef enum {dfUnknown, dfWaveform, dfParameters, dfTransParams, dfHypothesis} data_format; 03805 03806 // initialization 03807 virtual bool BSAPI_METHOD Init(const char *pConfigFile) = 0; 03808 03809 // live (microphone) input 03810 virtual bool BSAPI_METHOD RunLive() = 0; 03811 virtual void BSAPI_METHOD Terminate() = 0; 03812 03813 // processing of files 03814 virtual bool BSAPI_METHOD ProcessFile(data_format inputFormat, const char *pInputFile) = 0; 03815 virtual bool BSAPI_METHOD ProcessFileOut(data_format inputFormat, data_format outputFormat, const char *pSourceFile, const char *pTargetFile = 0) = 0; 03816 virtual bool BSAPI_METHOD ProcessLine(data_format inputFormat, data_format outputFormat, const char *pLine) = 0; 03817 03818 virtual bool BSAPI_METHOD ProcessListOut(data_format inputFormat, data_format outputFormat, const char *pFile, const char *pOutputMLF = 0) = 0; 03819 virtual bool BSAPI_METHOD ProcessListMemOut(data_format inputFormat, data_format outputFormat, const char *pMemory, const char *pOutputMLF = 0) = 0; 03820 virtual bool BSAPI_METHOD ProcessList(data_format inputFormat, const char *pFile) = 0; 03821 virtual bool BSAPI_METHOD ProcessListMem(data_format inputFormat, const char *pMemory) = 0; 03822 03823 // offline processing in memory 03824 virtual bool BSAPI_METHOD ProcessOffline(data_format inputFormat, data_format outputFormat, void *pInputSignal, int sigNBytes) = 0; 03825 virtual bool BSAPI_METHOD ProcessOfflineOut(data_format inputFormat, data_format outputFormat, void *pInputSignal, int sigNBytes, SFloatMatrixI *pOutputMatrix) = 0; 03826 virtual bool BSAPI_METHOD ProcessOfflineFeaOut(data_format inputFormat, data_format outputFormat, SFloatMatrixI *pInputMatrix, SFloatMatrixI *pOutputMatrix) = 0; 03827 03828 // offline processing in memory with segmentation, the output is sent to callbacks 03829 virtual bool BSAPI_METHOD ProcessSegmentation(data_format inputFormat, void *pInputSignal, int sigNBytes, segm_pos_type *pSegments) = 0; 03830 virtual bool BSAPI_METHOD ProcessSegmentationStr(data_format inputFormat, void *pInputSignal, int sigNBytes, const char *pSegments) = 0; 03831 virtual bool BSAPI_METHOD ProcessSegmentationFea(data_format inputFormat, SFloatMatrixI *pInputMatrix, segm_pos_type *pSegments) = 0; 03832 virtual bool BSAPI_METHOD ProcessSegmentationStrFea(data_format inputFormat, SFloatMatrixI *pInputMatrix, const char *pSegments) = 0; 03833 03834 // online processing in memory 03835 virtual bool BSAPI_METHOD ProcessOnline(data_format inputFormat, void *pInputSignal, int sigNBytes) = 0; 03836 virtual bool BSAPI_METHOD ProcessOnlineFea(data_format inputFormat, SFloatMatrixI *pInputMatrix) = 0; 03837 virtual bool BSAPI_METHOD Done() = 0; 03838 03839 // Handlers 03840 virtual void BSAPI_METHOD SetTarget(STransCallbackI *pTarget) = 0; 03841 virtual void BSAPI_METHOD SetStateHandler(SSpeechRecStateCallbackI *pStateHandler) = 0; 03842 03843 // Help functions 03844 virtual data_format BSAPI_METHOD Str2DataFormat(const char *pStr) = 0; 03845 virtual bool BSAPI_METHOD CheckDataFormatConversion(data_format from, data_format to) = 0; 03846 03847 // Setting 03848 virtual void BSAPI_METHOD SetStartFrameExtension(int startFrameExtension) = 0; 03849 virtual void BSAPI_METHOD SetEndFrameExtension(int endFrameExtension) = 0; 03850 virtual void BSAPI_METHOD SetControlReestimation(bool controlReestimation) = 0; 03851 03852 // Module accessors 03853 virtual SConfigureI * BSAPI_METHOD GetConfigure() = 0; 03854 virtual SAudioWaveformSourceI * BSAPI_METHOD GetAudioWaveformSource() = 0; 03855 virtual SFileWaveformSourceI * BSAPI_METHOD GetFileWaveformSource() = 0; 03856 virtual SWaveformFormatConvertorI * BSAPI_METHOD GetWaveformFormatConvertor() = 0; 03857 virtual SChannelSplitterI * BSAPI_METHOD GetChannelSplitter() = 0; 03858 virtual SWaveformFilterI * BSAPI_METHOD GetWaveformFilter() = 0; 03859 virtual SFeatureExtractionI * BSAPI_METHOD GetFeatureExtraction() = 0; 03860 virtual SFeatureTransformI * BSAPI_METHOD GetNormalization() = 0; 03861 virtual SFeatureTransformI * BSAPI_METHOD GetFeatureTransform1() = 0; 03862 virtual SFeatureTransformI * BSAPI_METHOD GetFeatureTransform2() = 0; 03863 virtual SDecoderI * BSAPI_METHOD GetDecoder() = 0; 03864 virtual SLabelMapperI * BSAPI_METHOD GetLabelMapper()= 0; 03865 virtual SERestI * BSAPI_METHOD GetERest() = 0; 03866 virtual SGrammarCompilerGroupI * BSAPI_METHOD GetGrammarCompilerGroup() = 0; 03867 }; 03868 03871 class SOfflineSpeechRecognizerI : public SUnknownI 03872 { 03873 public: 03874 virtual bool BSAPI_METHOD Init(const char *pConfigFile) = 0; // bs:include bs:only_if_set 03875 03876 virtual void BSAPI_METHOD SetOutputDirectory(const char *pOutputDirectory) = 0; 03877 virtual void BSAPI_METHOD SetOutputFileSuffix(const char *pSuffix) = 0; 03878 03879 virtual bool BSAPI_METHOD LoadNetwork(const char *pNetwork) = 0; // bs:include bs:only_if_set 03880 03881 virtual bool BSAPI_METHOD ProcessFile(const char *pInputFile, const char *pOutputFile = 0, const char *pOutSegmentFile = 0) = 0; 03882 virtual bool BSAPI_METHOD ProcessWaveform(SWaveformSourceCallbackI::wave_format_type waveformFormat, int sampleFreq, int nChannels, void *pData, int nBytes) = 0; 03883 03884 virtual void BSAPI_METHOD SetStateHandler(SOfflineSpeechRecCallbackI *pStateHandler) = 0; 03885 virtual void BSAPI_METHOD SetTarget(STransCallbackI *pTarget) = 0; 03886 03887 virtual SBlockSetI * BSAPI_METHOD GetBlockSet() = 0; 03888 }; 03889 03896 class SOfflineSpeechRecognizer3I : public SOfflineSpeechRecognizerI 03897 { 03898 public: 03899 virtual void BSAPI_METHOD SetSaveOneBest(bool save) = 0; 03900 virtual void BSAPI_METHOD SetSaveLattice(bool save) = 0; 03901 virtual void BSAPI_METHOD SetSaveConfusionNetwork(bool save) = 0; 03902 03903 virtual void BSAPI_METHOD SetOneBestOutputFormat(const char *pFormat) = 0; 03904 virtual void BSAPI_METHOD SetLatticeOutputFormat(const char *pFormat) = 0; 03905 virtual void BSAPI_METHOD SetConfusionNetworkOutputFormat(const char *pFormat) = 0; 03906 03907 virtual void BSAPI_METHOD SetSendOneBest(bool send) = 0; 03908 virtual void BSAPI_METHOD SetSendLattice(bool send) = 0; 03909 virtual void BSAPI_METHOD SetSendConfusionNetwork(bool send) = 0; 03910 }; 03911 03914 class SOnlineSpeechRecognizerI : public SUnknownI 03915 { 03916 public: 03917 virtual bool BSAPI_METHOD Init(const char *pConfigFile) = 0; // bs:include bs:only_if_set 03918 03919 virtual bool BSAPI_METHOD StartRecognition() = 0; 03920 virtual bool BSAPI_METHOD StopRecognition() = 0; 03921 03922 virtual bool BSAPI_METHOD StartMikeCalibration() = 0; 03923 virtual bool BSAPI_METHOD FinishMikeCalibration() = 0; 03924 03925 virtual void BSAPI_METHOD SetTarget(STransCallbackI *pTarget) = 0; 03926 }; 03927 03930 class SIsolatedWordRecognizerI : public SUnknownI 03931 { 03932 public: 03933 virtual bool BSAPI_METHOD Init(const char *pConfigFile) = 0; 03934 virtual bool BSAPI_METHOD Adapt(void *pData, int nBytes, SWaveformSourceCallbackI::wave_format_type format = SWaveformSourceCallbackI::wfLin16) = 0; 03935 virtual STransPosteriorsI * BSAPI_METHOD Recognize(void *pData, int nBytes, SWaveformSourceCallbackI::wave_format_type format = SWaveformSourceCallbackI::wfLin16) = 0; 03936 }; 03937 03940 class SBlockSetI : public SUnknownI 03941 { 03942 public: 03943 virtual bool BSAPI_METHOD Init(const char *pConfigFile) = 0; 03944 virtual SUnknownI * BSAPI_METHOD GetBlock(const char *pBlock) = 0; 03945 virtual bool BSAPI_METHOD Exists(const char *pBlock) = 0; 03946 virtual SConfigureI * BSAPI_METHOD GetConfigure() = 0; 03947 virtual void BSAPI_METHOD SetVariableTable(config_var_type *pVariableTable) = 0; 03948 }; 03949 03952 class SFeatureExtractionI : public SUnknownI, public SWaveformSourceCallbackI 03953 { 03954 public: 03955 virtual void BSAPI_METHOD SetTarget(SFeatureExtractionCallbackI *pTarget) = 0; 03956 virtual SFeatureExtractionCallbackI * BSAPI_METHOD GetTarget() = 0; 03957 virtual bool BSAPI_METHOD Done() = 0; 03958 virtual int BSAPI_METHOD GetNOutputs() = 0; 03959 }; 03960 03966 class SMelBanksI : public SFeatureExtractionI, public SParametersCallbackI 03967 { 03968 public: 03972 virtual void BSAPI_METHOD SetSampleFreq(int sampleFreq = 8000) = 0; 03976 virtual void BSAPI_METHOD SetVectorSize(int vectorSize = 200) = 0; 03980 virtual void BSAPI_METHOD SetStep(int step = 80) = 0; 03984 virtual void BSAPI_METHOD SetPreemCoef(float preemCoef = 0.0f) = 0; 03988 virtual void BSAPI_METHOD SetNBanks(int nBanks = 15) = 0; 03992 virtual void BSAPI_METHOD SetLowFreq(float loFreq = 0.0f) = 0; 03996 virtual void BSAPI_METHOD SetHighFreq(float hiFreq = 4000.0f) = 0; 04000 virtual void BSAPI_METHOD SetLowWarpFreq(float loFreq = 3000.0f) = 0; 04004 virtual void BSAPI_METHOD SetHighWarpFreq(float hiFreq = 3000.0f) = 0; 04009 virtual bool BSAPI_METHOD SetWarpAlpha(float alpha = 1.0f) = 0; 04017 virtual void BSAPI_METHOD SetWaitForWarpingFactor(bool waitForWarpingFactor = false) = 0; 04021 virtual void BSAPI_METHOD SetZMeanSource(bool zMeanSource = false) = 0; 04025 virtual void BSAPI_METHOD SetTakeLog(bool takeLog = true) = 0; 04029 virtual void BSAPI_METHOD SetUsePower(bool usePower = true) = 0; 04033 virtual void BSAPI_METHOD SetAddEnergy(bool addEnergy = false) = 0; 04039 virtual void BSAPI_METHOD SetUseRawEnergy(bool useRawEnergy = false) = 0; 04047 virtual void BSAPI_METHOD SetNormalizeEnergy(bool normalizeEnergy = false) = 0; 04051 virtual void BSAPI_METHOD SetEnergyScale(float energyScale = 0.1f) = 0; 04055 virtual void BSAPI_METHOD SetEnergyFloor(float energyFloor = 50.0f) = 0; 04059 virtual void BSAPI_METHOD SetDebug(bool debug = false) = 0; 04064 virtual void BSAPI_METHOD SetStartFrameRepetition(int startFrameRepetition = 0) = 0; 04069 virtual void BSAPI_METHOD SetEndFrameRepetition(int endFrameRepetition = 0) = 0; 04074 virtual void BSAPI_METHOD SetSpectralShiftHz(float spectralShiftHz = 0.0f) = 0; 04075 04076 virtual int BSAPI_METHOD GetSampleFreq() = 0; 04077 virtual int BSAPI_METHOD GetVectorSize() = 0; 04078 virtual int BSAPI_METHOD GetStep() = 0; 04079 virtual float BSAPI_METHOD GetPreemCoef() = 0; 04080 virtual int BSAPI_METHOD GetNBanks() = 0; 04081 virtual float BSAPI_METHOD GetLowFreq() = 0; 04082 virtual float BSAPI_METHOD GetHighFreq() = 0; 04083 virtual float BSAPI_METHOD GetWarpAlpha() = 0; 04084 virtual float BSAPI_METHOD GetLowWarpFreq() = 0; 04085 virtual float BSAPI_METHOD GetHighWarpFreq() = 0; 04086 virtual bool BSAPI_METHOD GetZMeanSource() = 0; 04087 virtual bool BSAPI_METHOD GetTakeLog() = 0; 04088 virtual float * BSAPI_METHOD GetCenters() = 0; 04089 virtual int BSAPI_METHOD GetStartFrameRepetition() = 0; 04090 virtual int BSAPI_METHOD GetEndFrameRepetition() = 0; 04091 04097 virtual void BSAPI_METHOD SetOutBatchSize(int outBatchSize = 0) = 0; 04098 virtual void BSAPI_METHOD Reset() = 0; 04099 }; 04100 04103 class SFeatureTransformI : public SUnknownI, public SFeatureExtractionCallbackI 04104 { 04105 public: 04106 virtual void BSAPI_METHOD SetTarget(SFeatureExtractionCallbackI *pTarget) = 0; 04107 virtual SFeatureExtractionCallbackI * BSAPI_METHOD GetTarget() = 0; 04108 virtual bool BSAPI_METHOD Done() = 0; 04109 virtual int BSAPI_METHOD GetNOutputs() = 0; 04110 virtual void BSAPI_METHOD SetStartFrameOffset(int offset = 0) = 0; 04111 }; 04112 04118 class SFeatureNodeI : public SFeatureTransformI 04119 { 04120 }; 04121 04125 class SMeanEstimationI : public SUnknownI, public SFeatureExtractionCallbackI 04126 { 04127 public: 04128 virtual void BSAPI_METHOD SetTarget(SFeatureExtractionCallbackI *pTarget) = 0; 04129 virtual SFeatureExtractionCallbackI * BSAPI_METHOD GetTarget() = 0; 04130 virtual void BSAPI_METHOD SetFileName(const char *pFilename = "means") = 0; 04131 }; 04132 04135 class SPLPI : public SFeatureTransformI 04136 { 04137 public: 04138 virtual void BSAPI_METHOD SetMelBanksInterface(SMelBanksI *pMelBanks) = 0; 04139 virtual void BSAPI_METHOD SetLpcOrder(int lpcOrder = 12) = 0; 04140 virtual void BSAPI_METHOD SetCompressFactor(float compressFactor = 0.3333333f) = 0; 04141 virtual void BSAPI_METHOD SetCepstralLifter(float cepstralLifter = 22.0f) = 0; 04142 virtual void BSAPI_METHOD SetCepstralScale(float cepstralScale = 10.0f) = 0; 04143 virtual void BSAPI_METHOD SetAddC0(bool addC0 = true) = 0; 04144 }; 04145 04148 class SMFCCI : public SFeatureTransformI 04149 { 04150 public: 04151 virtual void BSAPI_METHOD SetNCoefs(int nCoefs = 12) = 0; 04152 virtual void BSAPI_METHOD SetCepstralLifter(float cepstralLifter = 22.0f) = 0; 04153 virtual void BSAPI_METHOD SetCepstralScale(float cepstralScale = 1.0f) = 0; 04154 virtual void BSAPI_METHOD SetAddC0(bool addC0 = true) = 0; 04155 virtual void BSAPI_METHOD SetUsePrecomputedDCT(bool usePrecomputedDCT = true) = 0; 04156 virtual void BSAPI_METHOD SetPassEnergy(bool passEnergy = false) = 0; 04157 }; 04158 04161 class SF0EstimatorI : public SUnknownI, public SWaveformSourceCallbackI 04162 { 04163 public: 04164 virtual bool BSAPI_METHOD SetFeatureDefinition(const char *pStr = "f") = 0; 04165 virtual void BSAPI_METHOD SetStepMs(float stepMs = 10.0f) = 0; 04166 virtual void BSAPI_METHOD SetPreemCoef(float preemCoef = 0.0f) = 0; 04167 virtual void BSAPI_METHOD SetMinFreq(float minFreq = 50.0f) = 0; 04168 virtual void BSAPI_METHOD SetMaxFreq(float maxFreq = 550.0f) = 0; 04169 virtual void BSAPI_METHOD SetCorrelationLengthMs(float correlationLengthMs = 7.5f) = 0; 04170 virtual void BSAPI_METHOD SetMinXCorrValue(float minXCorrValue = 0.4f) = 0; 04171 virtual void BSAPI_METHOD SetRMSWindowLengthMs(float rmsWindowLengthMs = 30.0f) = 0; 04172 virtual void BSAPI_METHOD SetXCorrNormConst(float xCorrNormConst = 5000000.0f) = 0; 04173 virtual void BSAPI_METHOD SetToneConfidenceSlope1(float toneConfidenceSlope1 = 0.1f) = 0; 04174 virtual void BSAPI_METHOD SetMaximalToneBandWidth(float maximalToneBandWidth = 50.0f) = 0; 04175 virtual void BSAPI_METHOD SetToneConfidenceSlope2(float toneConfidenceSlope2 = 0.9f) = 0; 04176 virtual void BSAPI_METHOD SetMaxToneShift(float maxToneShift = 10.0f) = 0; 04177 virtual void BSAPI_METHOD SetMaxF0Hypothesis(int maxF0Hypothesis = 20) = 0; 04178 virtual void BSAPI_METHOD SetMaxDelay(int maxDelay = 1000) = 0; 04179 virtual void BSAPI_METHOD SetFreqDoubelingPenalty(float freqDoubelingPenalty = 0.35f) = 0; 04180 virtual void BSAPI_METHOD SetToVoicedPenalty(float toVoicedPenalty = 2.0f) = 0; 04181 virtual void BSAPI_METHOD SetUnvoicedPenalty(float unvoicedPenalty = 0.0f) = 0; 04182 virtual void BSAPI_METHOD SetVoicedPenalty(float voicedPenalty = 0.05f) = 0; 04183 virtual void BSAPI_METHOD SetToTonePenalty(float toTonePenalty = 2.0f) = 0; 04184 virtual void BSAPI_METHOD SetTonePenalty(float tonePenalty = 0.0f) = 0; 04185 virtual void BSAPI_METHOD SetToSpecStatPenalty(float toSpecStatPenalty = 2.0f) = 0; 04186 virtual void BSAPI_METHOD SetSpecStatPenalty(float specStatPenalty = 0.3f) = 0; 04187 virtual void BSAPI_METHOD SetTransitionScale(float transitionScale = 1.0f) = 0; 04188 virtual void BSAPI_METHOD SetLagWarpingFactor(float lagWarpingFactor = 0.3f) = 0; 04189 virtual void BSAPI_METHOD SetTarget(SFeatureExtractionCallbackI *pTarget) = 0; 04190 virtual void BSAPI_METHOD Reset() = 0; 04191 }; 04192 04198 class SF0SmoothingI : public SFeatureTransformI 04199 { 04200 public: 04201 virtual int BSAPI_METHOD GetVoiceLength() = 0; 04202 virtual int BSAPI_METHOD GetSilenceLength() = 0; 04203 virtual int BSAPI_METHOD GetToneLength() = 0; 04204 virtual int BSAPI_METHOD GetSpecStationarityLength() = 0; 04205 virtual int BSAPI_METHOD GetLowQuantizationVoiceLength() = 0; 04206 virtual float BSAPI_METHOD GetMinimalWaveformValue() = 0; 04207 virtual float BSAPI_METHOD GetMaximalWaveformValue() = 0; 04208 virtual float BSAPI_METHOD GetMaximalRootMeanSquare() = 0; 04209 04210 virtual void BSAPI_METHOD SetUseOriginalMatrix(bool useOriginalMatrix = true) = 0; 04211 virtual bool BSAPI_METHOD SetFeatureDefinition(const char *pFeatureDefinition = "f") = 0; 04212 virtual void BSAPI_METHOD SetVoiceExtension(int voiceExtension = 2) = 0; 04213 virtual void BSAPI_METHOD SetMinimalVoiceLength(int minimalVoiceLength = 5) = 0; 04214 virtual void BSAPI_METHOD SetMinimalVoiceDistance(int minimalVoiceDistance = 10) = 0; 04215 virtual void BSAPI_METHOD SetTechnicalSignalExtension(int technicalSignalExtension = 5) = 0; 04216 virtual void BSAPI_METHOD SetMinimalTechnicalSignalLength(int minimalLength = 10) = 0; 04217 virtual void BSAPI_METHOD SetMinimalNQuantizationLevels(int minimalNQuantLevels = 5) = 0; 04218 virtual void BSAPI_METHOD SetMaxVoiceAttenuationDb(float maxVoiceAttenuationDb = 20.0f) = 0; 04219 }; 04220 04223 class SF0EstimateToSegmConvertorI : public SUnknownI, public SFeatureExtractionCallbackI 04224 { 04225 public: 04226 virtual void BSAPI_METHOD SetF0Index(int f0Index) = 0; 04227 virtual void BSAPI_METHOD SetUseOnly2Classes(bool useOnly2Classes) = 0; 04228 virtual void BSAPI_METHOD SetTarget(STransCallbackI *pTarget) = 0; 04229 }; 04230 04233 class SIndexesToSegmConvertorI : public SUnknownI, public SParametersCallbackI 04234 { 04235 public: 04236 04237 virtual void BSAPI_METHOD SetChunkSize(int chunkSize = 0) = 0; 04238 virtual void BSAPI_METHOD SetTarget(STransCallbackI *pTarget) = 0; 04239 }; 04240 04248 class SFrequencyFilterI : public SUnknownI, public SWaveformSourceCallbackI 04249 { 04250 public: 04251 virtual float BSAPI_METHOD ProcessValue(float value) = 0; 04252 04253 virtual bool BSAPI_METHOD SetNumeratorCoefficients(int lenB, float *pB) = 0; 04254 virtual bool BSAPI_METHOD SetDenominatorCoefficients(int lenA, float *pA) = 0; 04255 virtual bool BSAPI_METHOD SetNumeratorCoefficientsStr(const char *pStr) = 0; 04256 virtual bool BSAPI_METHOD SetDenominatorCoefficientsStr(const char *pStr) = 0; 04257 04258 virtual bool BSAPI_METHOD Design(const char *pStr) = 0; 04259 virtual bool BSAPI_METHOD DesignSincLowPass(int n, float f, float fs, float magitude) = 0; 04260 virtual bool BSAPI_METHOD DesignSincHighPass(int n, float f, float fs, float magitude) = 0; 04261 virtual bool BSAPI_METHOD DesignSincBandPass(int n, float fMin, float fMax, float fs, float magitude) = 0; 04262 virtual bool BSAPI_METHOD DesignSincBandStop(int n, float fMin, float fMax, float fs, float magnitude) = 0; 04263 04264 virtual bool BSAPI_METHOD AmplitudeSpectra(float fMin, float fMax, float fs, int nFreqs, float *pOut) = 0; 04265 virtual int BSAPI_METHOD GetOrder() = 0; 04266 04267 virtual void BSAPI_METHOD Reset() = 0; 04268 virtual void BSAPI_METHOD SetWaveformTarget(SWaveformSourceCallbackI *pWaveformTarget) = 0; 04269 }; 04270 04273 class SNormalizationI : public SFeatureTransformI, public STransCallbackI, public SParametersCallbackI 04274 { 04275 public: 04276 virtual bool BSAPI_METHOD Save(const char *pFile) = 0; 04277 virtual bool BSAPI_METHOD Load(const char *pFile) = 0; // bs:include 04278 04279 virtual void BSAPI_METHOD SetChannel(int channel = 0) = 0; 04280 virtual void BSAPI_METHOD SetSpeechLabel(const char *pSpeechLabel = "voice") = 0; 04281 virtual void BSAPI_METHOD SetFrameShiftMs(int frameShiftMs = 10) = 0; 04282 virtual void BSAPI_METHOD SetAdaptTimeConst(float adaptTimeConst = 0.02f) = 0; 04283 virtual void BSAPI_METHOD SetBufferLength(int bufferLength = 200) = 0; 04284 virtual void BSAPI_METHOD SetMeanNorm(bool meanNorm = false) = 0; 04285 virtual void BSAPI_METHOD SetMeanNormOnFirstCoef(int meanFirst = -1) = 0; 04286 virtual void BSAPI_METHOD SetVarNorm(bool varNorm = false) = 0; 04287 virtual void BSAPI_METHOD SetScaleToGVar(bool scaleToGVar = false) = 0; 04288 04289 virtual void BSAPI_METHOD SetUseSegmentation(bool useSegmentation = false) = 0; 04290 virtual bool BSAPI_METHOD SetUseSentenceBasedNorm(bool useSentenceBasedNorm = false) = 0; 04291 virtual bool BSAPI_METHOD SetUseOnlineAdaptation(bool useOnlineAdaptation = false) = 0; 04292 04293 virtual void BSAPI_METHOD SetOmitStartFrames(int omitStartFrames = 0) = 0; 04294 virtual void BSAPI_METHOD SetOmitEndFrames(int omitEndFrames = 0) = 0; 04295 04296 virtual void BSAPI_METHOD SetUseInputMatrix(bool useInputMatrix = false) = 0; 04297 04298 virtual bool BSAPI_METHOD StartEstimation() = 0; 04299 virtual void BSAPI_METHOD EndEstimation() = 0; 04300 04301 virtual bool BSAPI_METHOD AddFeatures(SFloatMatrixI *pFeatures, int nFrames, segm_pos_type *pSegments = 0, int nSegments = 0, unsigned int flags = PF_LASTFRAME | PF_OFFLINEPROC) = 0; 04302 04303 virtual void BSAPI_METHOD SetParamHandler(SParametersCallbackI *pTarget) = 0; 04304 }; 04305 04308 class SOfflineNormalizationI : public SFeatureTransformI, public SParametersCallbackI 04309 { 04310 public: 04311 virtual bool BSAPI_METHOD Save(const char *pFile) = 0; 04312 virtual bool BSAPI_METHOD Load(const char *pFile) = 0; // bs:include 04313 04314 virtual void BSAPI_METHOD SetChannel(int channel = 0) = 0; 04315 virtual void BSAPI_METHOD SetMeanNorm(bool meanNorm = false) = 0; 04316 virtual void BSAPI_METHOD SetMeanNormOnFirstCoef(int meanFirst = -1) = 0; 04317 virtual void BSAPI_METHOD SetVarNorm(bool varNorm = false) = 0; 04318 virtual void BSAPI_METHOD SetScaleToGVar(bool scaleToGVar = false) = 0; 04319 04320 virtual void BSAPI_METHOD SetUseSentenceBasedNorm(bool useSentenceBasedNorm = true) = 0; 04321 virtual void BSAPI_METHOD SetEstimateNormParams(bool estimateNormParams = true) = 0; 04322 04323 virtual void BSAPI_METHOD SetOmitStartFrames(int omitStartFrames = 0) = 0; 04324 virtual void BSAPI_METHOD SetOmitEndFrames(int omitEndFrames = 0) = 0; 04325 04326 virtual bool BSAPI_METHOD StartEstimation() = 0; 04327 virtual bool BSAPI_METHOD EndEstimation() = 0; 04328 virtual bool BSAPI_METHOD Done() = 0; 04329 virtual int BSAPI_METHOD GetNOutputs() = 0; 04330 virtual void BSAPI_METHOD SetStartFrameOffset(int offset) = 0; 04331 04332 virtual void BSAPI_METHOD SetParamHandler(SParametersCallbackI *pTarget) = 0; 04333 }; 04334 04335 04338 class SNNetPosteriorEstimatorI : public SFeatureTransformI 04339 { 04340 public: 04341 // These functions should be called before Load(.) 04342 virtual bool BSAPI_METHOD SetSystem(const char *sys = "1BT_DCT") = 0; 04343 virtual void BSAPI_METHOD SetSofteningFunc(psoft_func_type pfunc, float v1, float v2, float v3) = 0; 04344 virtual bool BSAPI_METHOD SetSofteningFuncStr(const char *pSofteningFunc = "none 0 0 0") = 0; 04345 virtual void BSAPI_METHOD SetTrapLen(int trapLen = 31) = 0; 04346 virtual void BSAPI_METHOD SetUseHamming(bool useHamming = false) = 0; 04347 virtual void BSAPI_METHOD SetNBanks(int nBanks = 15) = 0; 04348 virtual void BSAPI_METHOD SetAddC0(bool addC0 = true) = 0; 04349 virtual void BSAPI_METHOD SetInvertBeforeMerger(bool invertBeforeMerger = true) = 0; 04350 virtual void BSAPI_METHOD SetFrameStep(int frameStep = 1) = 0; 04351 virtual void BSAPI_METHOD SetBatchSize(int batchSize = 1) = 0; 04352 virtual void BSAPI_METHOD SetOutBatchSize(int outBatchSize = 0) = 0; 04356 virtual void BSAPI_METHOD SetReadTransforms(bool readTransforms = true) = 0; 04357 virtual void BSAPI_METHOD SetUseFastExp(bool useFastExp = false) = 0; 04374 virtual bool BSAPI_METHOD Load(const char *pDir) = 0; // bs:include 04375 }; 04376 04379 class SFeaCatI : public SFeatureTransformI, public SParametersCallbackI 04380 { 04381 public: 04382 virtual void BSAPI_METHOD SetTransform(const char *pTransformName = "default") = 0; 04383 virtual bool BSAPI_METHOD SetTransformMatrix(const char *pTransformName, SFloatMatrixI &rTransformMatrix) = 0; 04384 virtual void BSAPI_METHOD SetStartFrameRepetition(int startFrameRepetition = 0) = 0; 04385 virtual void BSAPI_METHOD SetEndFrameRepetition(int endFrameRepetition = 0) = 0; 04386 virtual void BSAPI_METHOD SetOutBatchSize(int outBatchSize = 0) = 0; 04387 04388 virtual void BSAPI_METHOD Reset() = 0; 04389 virtual bool BSAPI_METHOD Load(const char *pFile) = 0; // bs:include 04390 }; 04391 04394 class SFeatureJoinerI : public SFeatureTransformI 04395 { 04396 public: 04397 virtual void BSAPI_METHOD Reset() = 0; 04398 }; 04399 04402 class SSTGI : public SFeatureTransformI 04403 { 04404 public: 04405 virtual bool BSAPI_METHOD Load(const char *pFile) = 0; 04406 virtual void BSAPI_METHOD Reset() = 0; 04407 virtual void BSAPI_METHOD SetLeftContext(int num = 0) = 0; 04408 virtual void BSAPI_METHOD SetRightContext(int num = 0) = 0; 04409 virtual void BSAPI_METHOD SetOutBatchSize(int num = 0) = 0; 04410 }; 04411 04414 class SDecoderI : public SUnknownI, public SFeatureExtractionCallbackI 04415 { 04416 public: 04417 virtual void BSAPI_METHOD SetTarget(STransCallbackI *pTarget) = 0; 04418 virtual bool BSAPI_METHOD EnableTransInterface(unsigned int interfaceID) = 0; 04419 virtual bool BSAPI_METHOD DisableTransInterface(unsigned int interfaceID) = 0; 04420 virtual bool BSAPI_METHOD SetTransInterfaces(const char *pTransInterfaces = "oneword") = 0; 04421 virtual bool BSAPI_METHOD LoadNetwork(const char *pFile) = 0; // bs:include bs:only_if_set 04422 virtual bool BSAPI_METHOD Done() = 0; 04423 virtual void BSAPI_METHOD SetStartFrameOffset(int offset = 0) = 0; 04424 }; 04425 04428 class SSTKDecoderI : public SDecoderI 04429 { 04430 public: 04431 virtual bool BSAPI_METHOD LoadModels(const char *pFile) = 0; // bs:include bs:only_if_set 04432 04433 virtual void BSAPI_METHOD SetBeamPruning(float v = 10e10f) = 0; 04434 virtual void BSAPI_METHOD SetTimePruning(long v = 0) = 0; 04435 virtual void BSAPI_METHOD SetPosteriorPruning(float v = 10e10f) = 0; 04436 virtual void BSAPI_METHOD SetPosteriorScale(float v = 1.0f) = 0; 04437 virtual void BSAPI_METHOD SetBaumWelshForPost(bool v = false) = 0; 04438 virtual void BSAPI_METHOD SetDumpWordNodes(bool v = true) = 0; 04439 virtual void BSAPI_METHOD SetDumpModelNodes(bool v = false) = 0; 04440 virtual void BSAPI_METHOD SetLmScale(float v = 1.0f) = 0; 04441 virtual void BSAPI_METHOD SetAcScale(float v = 1.0f) = 0; 04442 virtual void BSAPI_METHOD SetWordPenalty(float v = 0.0f) = 0; 04443 virtual void BSAPI_METHOD SetMaxActiveModels(int v = 0) = 0; 04444 virtual void BSAPI_METHOD SetRemoveNullNodes(bool v = false) = 0; 04445 virtual void BSAPI_METHOD SetSofteningFunc(psoft_func_type pfunc, float v1, float v2, float v3) = 0; 04446 virtual bool BSAPI_METHOD SetSofteningFuncStr(const char *pSofteningFunc = "none 0 0 0") = 0; 04447 virtual void BSAPI_METHOD SetUseCompactDecoder(bool useCompactDecoder = false) = 0; 04448 04449 virtual float BSAPI_METHOD GetBeamPruning() = 0; 04450 virtual long BSAPI_METHOD GetTimePruning() = 0; 04451 virtual float BSAPI_METHOD GetLmScale() = 0; 04452 virtual float BSAPI_METHOD GetAcScale() = 0; 04453 virtual float BSAPI_METHOD GetWordPenalty() = 0; 04454 }; 04455 04456 04459 class SKaldiDecoderI : public SDecoderI 04460 { 04461 public: 04462 virtual bool BSAPI_METHOD LoadModels(const char *pFile) = 0; // bs:include bs:only_if_set 04463 04464 virtual void BSAPI_METHOD SetBeamPruning(float v = 10e10f) = 0; 04465 04473 virtual void BSAPI_METHOD SetMaxLiveStates(int maxLiveStates = 0) = 0; 04474 virtual void BSAPI_METHOD SetLmScale(float v = 1.0f) = 0; 04475 virtual void BSAPI_METHOD SetWordPenalty(float v = 0.0f) = 0; 04476 04477 virtual float BSAPI_METHOD GetBeamPruning() = 0; 04478 virtual float BSAPI_METHOD GetLmScale() = 0; 04479 virtual float BSAPI_METHOD GetWordPenalty() = 0; 04480 }; 04481 04482 04485 class SPhnDecoderI : public SDecoderI 04486 { 04487 public: 04488 04489 virtual void BSAPI_METHOD SetWordPenalty(float v = 0.0f) = 0; 04490 virtual void BSAPI_METHOD SetTimePruning(long timePruning = 40) = 0; 04491 virtual void BSAPI_METHOD SetNStatesPerPhn(int nStatesPerPhn = 3) = 0; 04492 virtual void BSAPI_METHOD SetCurrTransProb(float prob = 0.5f) = 0; 04493 virtual void BSAPI_METHOD SetDumpEachFrame(bool dumpEachFrame = false) = 0; 04494 virtual void BSAPI_METHOD SetSofteningFunc(psoft_func_type pfunc, float v1, float v2, float v3) = 0; 04495 virtual bool BSAPI_METHOD SetSofteningFuncStr(const char *pSofteningFunc = "none 0 0 0") = 0; 04496 virtual long BSAPI_METHOD GetTimePruning() = 0; 04497 virtual float BSAPI_METHOD GetWordPenalty() = 0; 04498 }; 04499 04502 class SAlignerI : public SDecoderI 04503 { 04504 public: 04505 04506 virtual void BSAPI_METHOD SetWordPenalty(float v = 0.0f) = 0; 04507 virtual void BSAPI_METHOD SetTimePruning(long timePruning = 40) = 0; 04508 virtual void BSAPI_METHOD SetNStatesPerPhn(int nStatesPerPhn = 3) = 0; 04509 virtual void BSAPI_METHOD SetCurrTransProb(float prob = 0.5f) = 0; 04510 virtual void BSAPI_METHOD SetSofteningFunc(psoft_func_type pfunc, float v1, float v2, float v3) = 0; 04511 virtual bool BSAPI_METHOD SetSofteningFuncStr(const char *pSofteningFunc = "none 0 0 0") = 0; 04512 virtual long BSAPI_METHOD GetTimePruning() = 0; 04513 virtual float BSAPI_METHOD GetWordPenalty() = 0; 04514 virtual bool BSAPI_METHOD LoadPhnList(const char *pFile) = 0; 04515 virtual bool BSAPI_METHOD LoadNetworkFromMem(char **pData, int nNumPhonemes) = 0; 04516 }; 04517 04520 class SKWSDecoderI : public SDecoderI 04521 { 04522 public: 04523 virtual void BSAPI_METHOD SetBeamPruning(float v = 300.0f) = 0; 04524 virtual void BSAPI_METHOD SetTimePruning(long v = 99999) = 0; 04525 virtual void BSAPI_METHOD SetLmScale(float v = 1.0f) = 0; 04526 virtual void BSAPI_METHOD SetWordPenalty(float v = 0.0f) = 0; 04527 virtual void BSAPI_METHOD SetFrameNorm2WordLen(bool v = false) = 0; 04528 virtual void BSAPI_METHOD SetSofteningFunc(psoft_func_type pfunc, float v1, float v2, float v3) = 0; 04529 virtual bool BSAPI_METHOD SetSofteningFuncStr(const char *pSofteningFunc = "none 0 0 0") = 0; 04530 virtual void BSAPI_METHOD SetImproveEstimates(bool improveEstimates = false) = 0; 04531 virtual void BSAPI_METHOD SetBWEvaluation(bool BWEvaluation = false) = 0; 04532 virtual void BSAPI_METHOD SetThreshold(float threshold = -1.0e38f) = 0; 04533 04534 virtual bool BSAPI_METHOD LoadModels(const char *pFile) = 0; // bs:include bs:only_if_set 04535 04536 virtual float BSAPI_METHOD GetBeamPruning() = 0; 04537 virtual long BSAPI_METHOD GetTimePruning() = 0; 04538 virtual float BSAPI_METHOD GetLmScale() = 0; 04539 virtual float BSAPI_METHOD GetWordPenalty() = 0; 04540 }; 04541 04544 class SGMMDecoderI : public SDecoderI 04545 { 04546 public: 04547 virtual bool BSAPI_METHOD InitModel() = 0; //delete all models from memory 04548 virtual bool BSAPI_METHOD LoadModel(const char *pFile) = 0; //load without initialization 04549 virtual bool BSAPI_METHOD LoadModels(const char *pFile) = 0; // bs:include bs:only_if_set - load with initialization 04550 virtual void BSAPI_METHOD SetSofteningFunc(psoft_func_type pfunc, float v1, float v2, float v3) = 0; 04551 virtual bool BSAPI_METHOD SetSofteningFuncStr(const char *pSofteningFunc = "none 0 0 0") = 0; 04552 virtual float * BSAPI_METHOD GetModelScores(int *pNumValues) = 0; 04553 virtual char ** BSAPI_METHOD GetModelNames(int *pNumValues) = 0; 04554 virtual char * BSAPI_METHOD GetBestModel(float *pScore) = 0; 04555 virtual bool BSAPI_METHOD RemoveModel(const char *pName) = 0; 04556 virtual bool BSAPI_METHOD RenameModel(const char *pOldName, const char *pNewName) = 0; 04557 virtual void BSAPI_METHOD SetUseScoreNormalization(bool setNorm = false) = 0; 04558 virtual void BSAPI_METHOD SetUseEigenChannel(bool setEig = true) = 0; 04559 04560 }; 04561 04564 class SDataStreamNodeI : public SUnknownI, public SFeatureExtractionCallbackI, public STransCallbackI, public SChannelCallbackI 04565 { 04566 public: 04567 virtual bool BSAPI_METHOD ProcessFile(const char *pFileName) = 0; 04568 virtual void BSAPI_METHOD SetFileName(const char *pFileName) = 0; 04569 virtual void BSAPI_METHOD SetPerSegmentProcessing(bool perSegmentProcessing = false) = 0; 04570 virtual void BSAPI_METHOD SetSpeechLabel(const char *pSpeechLabel = "voice") = 0; 04571 virtual void BSAPI_METHOD SetEnabled(bool enabled = false) = 0; 04572 04573 virtual void BSAPI_METHOD SetIndexFileSuffix(const char *pIndexFileSuffix = "idx") = 0; 04574 virtual void BSAPI_METHOD SetFeatureFileSuffix(const char *pFeatureFileSuffix = "fea") = 0; 04575 04576 virtual void BSAPI_METHOD SetFeatureTarget(SFeatureExtractionCallbackI *pFeatureTarget) = 0; 04577 virtual void BSAPI_METHOD SetTransTarget(STransCallbackI *pTranscriptionTarget) = 0; 04578 virtual void BSAPI_METHOD SetChannelTarget(SChannelCallbackI *pChannelTarget) = 0; 04579 }; 04580 04583 class STranscriptionMemoryI : public SUnknownI, public STransCallbackI 04584 { 04585 public: 04586 virtual bool BSAPI_METHOD Save(const char *pFile, unsigned int flags = LBF_TIMES | LBF_SCORE) = 0; 04587 virtual bool BSAPI_METHOD Load(const char *pFile) = 0; 04588 04589 // if the requested IId is SIID_TRANS_SEGMARRAY (STransSegmentationArray interface), the following mapping is applied: 04590 // "voice" -> SE_VOICE; "silense" -> SE_SILENCE; "technical" -> SE_TECHNICAL; "music" ->SE_MUSIC; other -> SE_UNKNOWN 04591 virtual void BSAPI_METHOD SetSendOnIsLast(bool sendOnIsLast = false) = 0; 04592 virtual void BSAPI_METHOD SetClearOnIsLast(bool clearOnIsLast = false) = 0; 04593 virtual void BSAPI_METHOD SetPutIsLastOnWord(const char *pSpeechLabel = "") = 0; 04594 04595 virtual STranscriptionI * BSAPI_METHOD GetTranscription(unsigned int retuestedInterfaceId) = 0; 04596 virtual void BSAPI_METHOD Clear() = 0; 04597 virtual bool BSAPI_METHOD IsSentenceFinished() = 0; 04598 virtual float BSAPI_METHOD GetTotalSegmentLength(unsigned int label) = 0; 04599 04600 virtual int BSAPI_METHOD GetNWords() = 0; 04601 virtual void BSAPI_METHOD FirstWord() = 0; 04602 virtual STransOneWordI * BSAPI_METHOD GetWord() = 0; 04603 virtual bool BSAPI_METHOD PopWord(STransOneWordI **ppRetWord) = 0; 04604 virtual void BSAPI_METHOD PopAllWordsBeforeTime(long_long time) = 0; 04607 virtual void BSAPI_METHOD RemoveWord() = 0; 04608 04609 virtual void BSAPI_METHOD SetTarget(STransCallbackI *pTarget) = 0; 04610 virtual STransCallbackI * BSAPI_METHOD GetTarget() = 0; 04611 virtual bool BSAPI_METHOD Send(unsigned int containerIID, bool includeIsLastFlag = true) = 0; 04612 }; 04613 04616 class SFloatMatrixI : public SUnknownI 04617 { 04618 public: 04619 typedef enum {ffAscii, ffHTK, ffBinary} file_format_type; 04620 04621 virtual bool BSAPI_METHOD Init(unsigned int nr, unsigned int nc) = 0; 04622 virtual void BSAPI_METHOD InitSelection(SFloatMatrixI *pSource, int startRow, int endRow, int startColumn, int endColumn) = 0; 04623 virtual bool BSAPI_METHOD Assign(SFloatMatrixI *pMatrix) = 0; 04624 virtual void BSAPI_METHOD SetAll(float v) = 0; 04625 virtual float BSAPI_METHOD Get(unsigned int r, unsigned int c) = 0; 04626 virtual void BSAPI_METHOD Set(unsigned int r, unsigned int c, float v) = 0; 04627 virtual int BSAPI_METHOD GetStride() = 0; 04628 virtual float * BSAPI_METHOD GetMem() = 0; 04629 virtual float * BSAPI_METHOD GetRowMem(int r) = 0; 04630 virtual void BSAPI_METHOD SetRow(int r, float *pMem) = 0; 04631 virtual int BSAPI_METHOD GetNRows() = 0; 04632 virtual int BSAPI_METHOD GetNColumns() = 0; 04633 virtual void BSAPI_METHOD SetFromMem(float *pMem, int alignment = 0) = 0; 04634 virtual bool BSAPI_METHOD Load(const char *pFile, file_format_type format = ffAscii) = 0; 04635 virtual bool BSAPI_METHOD Save(const char *pFile, file_format_type format = ffAscii) = 0; 04636 virtual void BSAPI_METHOD Dump() = 0; 04637 virtual bool BSAPI_METHOD SaveSelection(const char *pFile, file_format_type format, int rStart, int rEnd, int cStart, int cEnd) = 0; 04638 }; 04639 04642 class SIntMatrixI : public SUnknownI 04643 { 04644 public: 04645 typedef enum {ffAscii, ffHTK, ffBinary} file_format_type; 04646 04647 virtual bool BSAPI_METHOD Init(unsigned int nr, unsigned int nc) = 0; 04648 virtual void BSAPI_METHOD InitSelection(SIntMatrixI *pSource, int startRow, int endRow, int startColumn, int endColumn) = 0; 04649 virtual bool BSAPI_METHOD Assign(SIntMatrixI *pMatrix) = 0; 04650 virtual void BSAPI_METHOD SetAll(int v) = 0; 04651 virtual int BSAPI_METHOD Get(unsigned int r, unsigned int c) = 0; 04652 virtual void BSAPI_METHOD Set(unsigned int r, unsigned int c, int v) = 0; 04653 virtual int BSAPI_METHOD GetStride() = 0; 04654 virtual int * BSAPI_METHOD GetMem() = 0; 04655 virtual int * BSAPI_METHOD GetRowMem(int r) = 0; 04656 virtual void BSAPI_METHOD SetRow(int r, int *pMem) = 0; 04657 virtual int BSAPI_METHOD GetNRows() = 0; 04658 virtual int BSAPI_METHOD GetNColumns() = 0; 04659 virtual void BSAPI_METHOD SetFromMem(int *pMem, int alignment = 0) = 0; 04660 virtual bool BSAPI_METHOD Load(const char *pFile, file_format_type format = ffAscii) = 0; 04661 virtual bool BSAPI_METHOD Save(const char *pFile, file_format_type format = ffAscii) = 0; 04662 virtual bool BSAPI_METHOD SaveSelection(const char *pFile, file_format_type format, int rStart, int rEnd, int cStart, int cEnd) = 0; 04663 }; 04664 04667 class SFeatureMemoryI : public SUnknownI, public SFeatureExtractionCallbackI 04668 { 04669 public: 04670 virtual bool BSAPI_METHOD Save(const char *pFile, SFloatMatrixI::file_format_type fileFormat = SFloatMatrixI::ffHTK) = 0; 04671 virtual bool BSAPI_METHOD Load(const char *pFile, SFloatMatrixI::file_format_type fileFormat = SFloatMatrixI::ffHTK) = 0; 04672 virtual int BSAPI_METHOD GetNFeatures() = 0; 04673 virtual void BSAPI_METHOD FirstFeature() = 0; 04674 virtual fea_type * BSAPI_METHOD GetFeature() = 0; 04675 virtual bool BSAPI_METHOD PopFirstFeature() = 0; 04676 virtual void BSAPI_METHOD Clear() = 0; 04677 04678 virtual void BSAPI_METHOD SetTarget(SFeatureExtractionCallbackI *pTarget) = 0; 04679 virtual bool BSAPI_METHOD Send() = 0; 04680 }; 04681 04684 class SFeatureSegmenterI : public SUnknownI, public SFeatureExtractionCallbackI, public STransCallbackI 04685 { 04686 public: 04691 virtual void BSAPI_METHOD SetSegmentStartFrameExtension(int segmentStartFrameExtension = 0) = 0; 04692 04697 virtual void BSAPI_METHOD SetSegmentEndFrameExtension(int segmentEndFrameExtension = 0) = 0; 04698 04709 virtual void BSAPI_METHOD SetRepeatFrames(bool repeatFrames = false) = 0; 04710 04716 virtual void BSAPI_METHOD SetStartFrameOffset(int startFrameOffset = 0) = 0; 04717 04721 virtual void BSAPI_METHOD SetWaitForWholeSentence(bool waitForWholeSentence = false) = 0; 04722 04728 virtual void BSAPI_METHOD SetSpeechLabel(const char *pSpeechLabel = "voice") = 0; 04729 04735 virtual void BSAPI_METHOD SetFrameShiftMs(int frameShiftMs = 10) = 0; 04736 04741 virtual void BSAPI_METHOD SetTarget(SFeatureExtractionCallbackI *pTarget) = 0; 04742 }; 04743 04746 class SOnlineFeatureSegmenterI : public SUnknownI, public SFeatureExtractionCallbackI, public STransCallbackI 04747 { 04748 public: 04749 04753 virtual void BSAPI_METHOD SetOutBatchSize(int outBatchSize = 0) = 0; 04754 04760 virtual void BSAPI_METHOD SetSpeechLabel(const char *pSpeechLabel = "voice") = 0; 04761 04767 virtual void BSAPI_METHOD SetFrameShiftMs(int frameShiftMs = 10) = 0; 04768 04773 virtual void BSAPI_METHOD SetTarget(SFeatureExtractionCallbackI *pTarget) = 0; 04774 }; 04775 04778 class STranscriptionSegmenterI : public SUnknownI, public STransCallbackI 04779 { 04780 public: 04784 virtual void BSAPI_METHOD SetWaitForWholeSentence(bool waitForWholeSentence = false) = 0; 04785 04791 virtual void BSAPI_METHOD SetSpeechLabel(const char *pSpeechLabel = "voice") = 0; 04792 04798 virtual void BSAPI_METHOD SetSilenceLabel(const char *pSpeechLabel = "silence") = 0; 04799 04803 virtual void BSAPI_METHOD SetUseRelativeTiming(bool useRelativeTiming = true) = 0; 04804 04805 04809 virtual void BSAPI_METHOD SetInheritIsLast(bool inheritIsLast = false) = 0; 04810 04815 virtual void BSAPI_METHOD SetTarget(STransCallbackI *pTarget) = 0; 04816 }; 04817 04820 class SLinearTransformI : public SUnknownI, public SParametersCallbackI 04821 { 04822 public: 04823 virtual bool BSAPI_METHOD Load(const char *pFile) = 0; // bs:include bs:only_if_set 04824 virtual bool BSAPI_METHOD Save(const char *pFile) = 0; 04825 04826 virtual bool BSAPI_METHOD SetMatrixFormatStr(const char *pMatrixFormatStr = "htk") = 0; 04827 virtual void BSAPI_METHOD SetMatrixFormat(SFloatMatrixI::file_format_type matrixFormat = SFloatMatrixI::ffHTK) = 0; 04828 04829 virtual bool BSAPI_METHOD CreateDCT(int nIn, int nOut) = 0; 04830 virtual void BSAPI_METHOD ApplyToVector(float *pIn, float *pOut) = 0; 04831 04832 virtual int BSAPI_METHOD GetInputSize() = 0; 04833 virtual int BSAPI_METHOD GetOutputSize() = 0; 04834 04835 virtual void BSAPI_METHOD SetUseInputData(bool useInputData = false) = 0; 04836 virtual void BSAPI_METHOD SetParamTarget(SParametersCallbackI *pTarget) = 0; 04837 }; 04838 04841 class SLexiconI : public SUnknownI 04842 { 04843 public: 04844 virtual void BSAPI_METHOD Clear() = 0; 04845 04846 virtual bool BSAPI_METHOD AddWord(const char *pWord, const char *mpTrans, float prob, int part = 0) = 0; 04847 virtual bool BSAPI_METHOD RemoveWord(const char *pWord, int part = LEX_ALLPARTS) = 0; 04848 04849 virtual bool BSAPI_METHOD WordExists(const char *pWord) = 0; 04850 04851 virtual te_type * BSAPI_METHOD GetTranscs(const char *pWord, int *pNVars = 0) = 0; 04852 virtual void BSAPI_METHOD ReleaseTranscs(te_type *pList) = 0; 04853 04854 // file1,part1,[ascii|binary];file2,part2,[ascii|binary] 04855 virtual bool BSAPI_METHOD Load(const char *pFileStrings) = 0; // bs:include bs:only_if_set 04856 04857 virtual bool BSAPI_METHOD LoadPart(const char *pFile, int part = 0, bool saveBin = false) = 0; 04858 virtual bool BSAPI_METHOD Save(const char *pFile = 0, int part = 0, bool saveBin = false) = 0; 04859 04860 virtual void BSAPI_METHOD SetActPart(int v = LEX_ALLPARTS) = 0; 04861 }; 04862 04865 class SG2PI : public SUnknownI 04866 { 04867 public: 04868 virtual bool BSAPI_METHOD LoadRules(const char *pFile) = 0; // bs:include bs:only_if_set 04869 virtual bool BSAPI_METHOD LoadSymbols(const char *pFile) = 0; // bs:include bs:only_if_set 04870 virtual bool BSAPI_METHOD LoadInternalCharsetTable(const char *pFile) = 0; // bs:include bs:only_if_set 04871 virtual bool BSAPI_METHOD LoadExternalCharsetTable(const char *pFile) = 0; // bs:include bs:only_if_set 04872 04873 04874 virtual bool BSAPI_METHOD GetInitFlag() = 0; 04875 virtual void BSAPI_METHOD ClearInitFlag() = 0; 04876 04877 virtual te_type * BSAPI_METHOD GetTranscs(const char *pWord, int *pNVars = 0) = 0; 04878 virtual void BSAPI_METHOD ReleaseTranscs(te_type *pList) = 0; 04879 virtual bool BSAPI_METHOD GetBestTransc(char *pWord, char *pTrans) = 0; 04880 04881 virtual void BSAPI_METHOD SetMaxProns(int v = -1) = 0; 04882 virtual void BSAPI_METHOD SetScalePronProb(bool v = false) = 0; 04883 virtual void BSAPI_METHOD SetLowestPronProb(float v = -1.0f) = 0; 04884 04885 virtual bool BSAPI_METHOD RemoveUnknownGraphemes(char *pStr) = 0; 04886 }; 04887 04890 class SPhnTransI : public SUnknownI 04891 { 04892 public: 04893 typedef enum {ptmLexicon, ptmG2P, ptmUnion, ptmLexG2P} mode_type; 04894 04895 virtual void BSAPI_METHOD SetLexicon(SLexiconI *pLex) = 0; 04896 virtual void BSAPI_METHOD SetG2P(SG2PI *pG2P) = 0; 04897 virtual void BSAPI_METHOD SetMode(mode_type m) = 0; 04898 virtual void BSAPI_METHOD SetModeStr(const char *pMode) = 0; //lexicon, g2p, union, lex_g2p 04899 04900 virtual SLexiconI * BSAPI_METHOD GetLexicon() = 0; 04901 virtual SG2PI * BSAPI_METHOD GetG2P() = 0; 04902 04903 virtual te_type * BSAPI_METHOD GetTranscs(const char *pWord, int *pNVars) = 0; 04904 virtual void BSAPI_METHOD ReleaseTranscs(te_type *pList) = 0; 04905 04906 virtual bool BSAPI_METHOD LoadPhonemeList(const char *pFile) = 0; // bs:include bs:only_if_set 04907 virtual bool BSAPI_METHOD LoadCharacterList(const char *pFile) = 0; // bs:include bs:only_if_set 04908 virtual void BSAPI_METHOD CheckPronunciation(const char *pPronunciation, bool *pRetValid, char *pRetUnknownPhonemes, int maxLength) = 0; 04909 virtual bool BSAPI_METHOD CheckWordName(const char *pWord, bool *pRetValid, char *pRetUnknownCharacters, int maxLength) = 0; 04910 }; 04911 04914 class SNetworkI : public SUnknownI 04915 { 04916 }; 04917 04920 class SGrammarCompilerI : public SUnknownI 04921 { 04922 public: 04923 virtual SNetworkI * BSAPI_METHOD Compile(const char *pText) = 0; 04924 virtual SNetworkI * BSAPI_METHOD CompileFile(const char *pFile) = 0; 04925 virtual SNetworkI * BSAPI_METHOD Load(const char *pFile) = 0; 04926 virtual bool BSAPI_METHOD CanCompile(const char *pText) = 0; 04927 virtual bool BSAPI_METHOD CanLoad(const char *pFile) = 0; 04928 virtual void BSAPI_METHOD SetCompilerGroup(SGrammarCompilerGroupI *pGroup) = 0; 04929 }; 04930 04933 class SGrammarCompilerGroupI : public SUnknownI 04934 { 04935 public: 04936 virtual SPhnTransI * BSAPI_METHOD GetPhnTrans() = 0; 04937 virtual void BSAPI_METHOD SetPhnTrans(SPhnTransI *pPT) = 0; 04938 virtual SGrammarCompilerI * BSAPI_METHOD GetCompiler(unsigned int id) = 0; 04939 04940 virtual SNetworkI * BSAPI_METHOD Compile(const char *pText) = 0; 04941 virtual SNetworkI * BSAPI_METHOD CompileFile(const char *pFile) = 0; 04942 virtual SNetworkI * BSAPI_METHOD Load(const char *pFile) = 0; 04943 }; 04944 04947 class SGrammarListI : public SUnknownI 04948 { 04949 public: 04950 virtual bool BSAPI_METHOD Add(char *pStrGrammarId, SNetworkI *pNet, unsigned int flags = 0) = 0; 04951 virtual SNetworkI *BSAPI_METHOD Get(char *pStrGrammarId) = 0; 04952 virtual void RemoveById(char *pStrGrammarId) = 0; 04953 virtual void Remove(SNetworkI *pNet) = 0; 04954 virtual void RemoveAll(unsigned int flags) = 0; 04955 virtual void RemoveAndReleaseAll(unsigned int flags) = 0; 04956 virtual SPhnTransI *GetPhnTrans() = 0; 04957 }; 04958 04961 class SFunction1DI 04962 { 04963 public: 04964 virtual double BSAPI_METHOD Evaluate(double value, bool *pValidRetVal) = 0; 04965 }; 04966 04969 class SFMinSearch1DI : public SUnknownI 04970 { 04971 public: 04972 virtual void BSAPI_METHOD SetRange(double min, double max) = 0; 04973 virtual void BSAPI_METHOD SetStopDeltaX(double stopDeltaX) = 0; 04974 virtual void BSAPI_METHOD SetStopDeltaY(double stopDeltaY) = 0; 04975 virtual void BSAPI_METHOD SetMaxNIterations(unsigned int maxNIterations) = 0; 04976 virtual void BSAPI_METHOD SetLogProgress(bool logProgress) = 0; 04977 04978 virtual double BSAPI_METHOD GetX() = 0; 04979 virtual double BSAPI_METHOD GetMinimum() = 0; 04980 04981 virtual double BSAPI_METHOD Search() = 0; 04982 virtual bool BSAPI_METHOD Found() = 0; 04983 04984 virtual void BSAPI_METHOD SetFunction(SFunction1DI *pFunction) = 0; 04985 }; 04986 04989 class SPieceWiseFunc2DI : public SUnknownI 04990 { 04991 public: 04992 virtual bool BSAPI_METHOD LoadFuncValues(const char *pFile) = 0; // bs:include bs:only_if_set 04993 virtual bool BSAPI_METHOD SetFuncValues(SFloatMatrixI *pFuncValues) = 0; 04994 virtual float BSAPI_METHOD Evaluate(float x, float y) = 0; 04995 }; 04996 04999 class SKWSNetworkGeneratorI : public SUnknownI 05000 { 05001 public: 05002 // these two functions are obsolete and will be removed 05003 virtual bool BSAPI_METHOD GenerateFromList(const char *pWordList, const char *pOutputFile) = 0; 05004 virtual bool BSAPI_METHOD GenerateFromFile(const char *pWordListFile, const char *pOutputFile) = 0; 05005 05006 virtual void BSAPI_METHOD SetKeywordList(SKeywordListI *pkeyword_list) = 0; 05007 virtual bool BSAPI_METHOD Generate(const char *pOutputFile) = 0; 05008 }; 05009 05012 class SCIPhnLoopKWSNetGenI : public SKWSNetworkGeneratorI 05013 { 05014 public: 05015 // this function is obsolete and will be removed 05016 virtual void BSAPI_METHOD SetPhnTrans(SPhnTransI *pPhnTrans) = 0; 05017 virtual bool BSAPI_METHOD LoadPhonemeList(const char *pFile) = 0; // bs:include bs:only_if_set 05018 virtual void BSAPI_METHOD SetAddPronIds(bool addPronIds) = 0; 05019 }; 05020 05023 class SGMMBasedEstimatorI : public SUnknownI, public SFeatureExtractionCallbackI, public STransCallbackI 05024 { 05025 public: 05026 05030 virtual void BSAPI_METHOD SetModelSuffix(const char *pModelSuffix = "gmm") = 0; 05031 05035 virtual bool BSAPI_METHOD LoadModels(const char *pModelDirectory) = 0; // bs:include bs:only_if_set 05036 05040 virtual void BSAPI_METHOD SetTarget(SParametersCallbackI *pTarget) = 0; 05041 05046 virtual bool BSAPI_METHOD SetEstimationMode(const char *pEstimationMode = "sum") = 0; 05047 05054 virtual void BSAPI_METHOD SetSpeechLabel(const char *pSpeechLabel = "voice") = 0; 05055 05063 virtual void BSAPI_METHOD SetFrameShiftMs(int frameShiftMs = 10) = 0; 05064 05074 virtual void BSAPI_METHOD SetUseSegmentation(bool useSegmentation = true) = 0; 05075 05076 virtual void BSAPI_METHOD SetBufferLength(int bufferLength = 0) = 0; 05077 virtual void BSAPI_METHOD SetFrameBunchLength(int frameBunchLength = 50) = 0; 05078 virtual void BSAPI_METHOD SetAdaptMinFrames(int adaptMinFrames = 50) = 0; 05079 virtual void BSAPI_METHOD SetAdaptTimeConst(float adaptTimeConst = 0.02f) = 0; 05080 virtual void BSAPI_METHOD SetOutputStep(int outputStep = 0) = 0; 05081 virtual void BSAPI_METHOD SetUseFactor(bool useFactor = false) = 0; 05082 virtual void BSAPI_METHOD SetDefaultFactor(float defaultFactor = 1.0f) = 0; 05083 virtual bool BSAPI_METHOD SetFileNameFactorRange(const char *pRange = "1:3") = 0; 05084 virtual void BSAPI_METHOD SetFileNameFactorScale(float scale = 0.01f) = 0; 05085 virtual void BSAPI_METHOD SetFrameStride(int frameStride = 1) = 0; 05086 05101 virtual bool BSAPI_METHOD AddFeatures(SFloatMatrixI *pFeatures, int nFrames, segm_pos_type *pSegments = 0, int nSegments = 0, unsigned int flags = PF_LASTFRAME | PF_OFFLINEPROC) = 0; 05102 05106 virtual int BSAPI_METHOD GetNUsedFrames() = 0; 05107 05111 virtual float BSAPI_METHOD GetFactor() = 0; 05112 05117 virtual float * BSAPI_METHOD GetClassScores(int *pNumValues = 0) = 0; 05118 05123 virtual char ** BSAPI_METHOD GetClassNames(int *pNumValues = 0) = 0; 05124 05129 virtual char * BSAPI_METHOD GetBestClass(float *pScore = 0) = 0; 05130 05136 virtual bool BSAPI_METHOD Restart() = 0; 05137 }; 05138 05141 class SGMMStatisticCollectorI : public SUnknownI, public SFeatureExtractionCallbackI 05142 { 05143 public: 05144 virtual void BSAPI_METHOD SetSelectionNBest(int selectionNBest = 0) = 0; 05145 virtual void BSAPI_METHOD SetNormalizeByMean(bool normalizeByMean = false) = 0; 05146 virtual void BSAPI_METHOD SetNormalizeByStdDev(bool normalizeByStdDev = false) = 0; 05147 virtual void BSAPI_METHOD SetCollectSecondOrderStats(bool collectSecondOrderStats = false) = 0; 05148 virtual void BSAPI_METHOD SetOutBatchSize(int outBatchSize = 0) = 0; 05149 virtual void BSAPI_METHOD SetDumpStatistics(bool dumpStatistics = false) = 0; 05150 virtual void BSAPI_METHOD SetTarget(SStatisticsCallbackI *pTarget) = 0; 05151 05152 virtual void BSAPI_METHOD Reset() = 0; 05153 05154 virtual bool BSAPI_METHOD LoadModel(const char *pFile) = 0; // bs:include bs:only_if_set 05155 virtual bool BSAPI_METHOD LoadSelectionModel(const char *pFile) = 0; // bs:include bs:only_if_set 05156 virtual bool BSAPI_METHOD LoadSelectionTable(const char *pFile) = 0; // bs:include bs:only_if_set 05157 }; 05158 05161 class SIVectorExtractorI : public SUnknownI, public SStatisticsCallbackI 05162 { 05163 public: 05164 virtual bool BSAPI_METHOD LoadIMatrix(const char *pFile) = 0; // bs:include bs:only_if_set 05165 virtual void BSAPI_METHOD SetNBest(int nBest = 0) = 0; 05166 virtual void BSAPI_METHOD SetCollapsedComputations(bool collapsedComputations = false) = 0; 05167 virtual void BSAPI_METHOD SetNormalizeToUnitLength(bool normalizeToUnitLength = false) = 0; 05168 virtual bool BSAPI_METHOD LoadMean(const char *pFile) = 0; // bs:include bs:only_if_set 05169 virtual bool BSAPI_METHOD LoadViVitMatrices(const char *pFile) = 0; // bs:include bs:only_if_set 05170 virtual bool BSAPI_METHOD SaveViVitMatrices(const char *pFile) = 0; 05171 virtual void BSAPI_METHOD SetTarget(SParametersCallbackI *pTarget) = 0; 05172 }; 05173 05178 class SVectorQuantizerI : public SUnknownI, public SFeatureExtractionCallbackI 05179 { 05180 public: 05188 virtual void BSAPI_METHOD SetUseInputMatrix(bool useInputMatrix = false) = 0; 05189 05193 virtual void BSAPI_METHOD SetNormalizeToUnitLength(bool normalizeToUnitLength = true) = 0; 05194 05203 virtual void BSAPI_METHOD SetMaxAvgDistance(float maxAvgDistance = 0.01f) = 0; 05204 05208 virtual void BSAPI_METHOD SetCentroidSplitOffset(float centroidSplitOffset = 0.01f) = 0; 05209 05216 virtual void BSAPI_METHOD SetTotalClusters(int totalClusters = 0) = 0; 05217 05226 virtual void BSAPI_METHOD SetMaxClusters(int maxClusters = 0) = 0; 05227 05231 virtual int BSAPI_METHOD GetNClusters() = 0; 05232 05237 virtual void BSAPI_METHOD SetDistanceFunc(pdist_func_type pDistanceFunc) = 0; 05238 05244 virtual bool BSAPI_METHOD SetDistanceFuncStr(const char *pDistanceFuncStr = "cosine") = 0; 05245 05252 virtual void BSAPI_METHOD SetParamTarget(SParametersCallbackI *pTarget) = 0; 05253 05258 virtual void BSAPI_METHOD SetTarget(SFeatureExtractionCallbackI *pTarget) = 0; 05259 }; 05260 05263 class SIVectorsToFeatureMatrixConvertorI : public SUnknownI, public SParametersCallbackI 05264 { 05265 public: 05266 virtual SFeatureExtractionCallbackI * BSAPI_METHOD GetTarget() = 0; 05267 virtual void BSAPI_METHOD SetTarget(SFeatureExtractionCallbackI *pTarget) = 0; 05268 }; 05269 05274 class SIVectorToVoicePrintConvertorI : public SUnknownI, public SParametersCallbackI 05275 { 05276 public: 05277 virtual void BSAPI_METHOD SetVoicePrintVersion(int voicePrintVersion) = 0; 05278 virtual void BSAPI_METHOD SetTarget(SParametersCallbackI *pTarget) = 0; 05279 }; 05280 05283 class SFeatureMatrixToIVectorsConvertorI : public SUnknownI, public SFeatureExtractionCallbackI 05284 { 05285 public: 05286 virtual SParametersCallbackI * BSAPI_METHOD GetTarget() = 0; 05287 virtual void BSAPI_METHOD SetTarget(SParametersCallbackI *pTarget) = 0; 05288 }; 05289 05292 class SVtlnOfflineI : public SUnknownI 05293 { 05294 public: 05295 virtual bool BSAPI_METHOD Init(const char *pConfigFile) = 0; 05296 05297 virtual float BSAPI_METHOD SearchFromFile(const char *pFile) = 0; 05298 virtual float BSAPI_METHOD SearchFromList(const char *pFile) = 0; 05299 virtual float BSAPI_METHOD SearchFromListMem(const char *pMem) = 0; 05300 virtual float BSAPI_METHOD Search(SWaveformSourceCallbackI::wave_format_type waveformFormat, int sampleFreq, void *pData, int nBytes, segm_pos_type *pSegments) = 0; 05301 05302 virtual SFMinSearch1DI * BSAPI_METHOD GetSearcher() = 0; 05303 }; 05304 05307 class SERestI : public SUnknownI, public SFeatureExtractionCallbackI, public STransCallbackI 05308 { 05309 public: 05310 // processing 05311 virtual bool BSAPI_METHOD Prepare() = 0; 05312 virtual bool BSAPI_METHOD ProcessOneUtterance(SFloatMatrixI *pMatrix1, SFloatMatrixI *pMatrix2, const char *pLabelFile, bool *pOverPruned = 0) = 0; 05313 virtual bool BSAPI_METHOD Done() = 0; 05314 virtual bool BSAPI_METHOD Reest(SFloatMatrixI *pMatrix1, SFloatMatrixI *pMatrix2, const char *pLabelFile) = 0; 05315 virtual bool BSAPI_METHOD GetStats(const char* pLabel, SFloatMatrixI * pMeanMatrixOut, SFloatMatrixI * pCovMatrixOut, float * pOccupOut) = 0; 05316 virtual bool BSAPI_METHOD ClearStats(const char* pLabel) = 0; 05317 virtual bool BSAPI_METHOD WriteXformStatsAndRunCommands(const char * pOutDir, bool binary) = 0; 05318 virtual void BSAPI_METHOD SetLabel(const char *pLabel) = 0; 05319 virtual void BSAPI_METHOD SetTarget(SStatisticsCallbackI *pTarget) = 0; 05320 05321 // loading/saving models 05322 virtual bool BSAPI_METHOD LoadModels(const char *pModels) = 0; // bs:include bs:only_if_set 05323 virtual bool BSAPI_METHOD LoadHMMList(const char *pHMMList) = 0; // bs:include bs:only_if_set 05324 virtual bool BSAPI_METHOD LoadAlignModels(const char *pModels) = 0; // bs:include bs:only_if_set 05325 virtual bool BSAPI_METHOD LoadAlignHMMList(const char *pHMMList) = 0; // bs:include bs:only_if_set 05326 virtual bool BSAPI_METHOD LoadPriorModels(const char *pModels) = 0; // bs:include bs:only_if_set 05327 virtual bool BSAPI_METHOD LoadPriorHMMList(const char *pHMMList) = 0; // bs:include bs:only_if_set 05328 virtual bool BSAPI_METHOD LoadDictionary(const char *pDict) = 0; 05329 virtual bool BSAPI_METHOD SaveModels(const char *mpFile, bool binary) = 0; 05330 virtual bool BSAPI_METHOD SaveModelsRename(const char *mpFile, bool binary, char * pNameOrig, char * pNameNew) = 0; 05331 05332 // utterance name 05333 virtual void BSAPI_METHOD SetUtteranceName(const char *pUtteranceName) = 0; 05334 05335 // what to do 05336 virtual bool BSAPI_METHOD SetUpdateMask(const char *pMask = "tmvwsx") = 0; // t - transition, m - mean, v - variance, w - weight, 05337 // s - xfstats, x - xform, o - old mean and var 05338 // p - MAP, c - cweights 05339 virtual bool BSAPI_METHOD SetUpdateType(const char *pType = "ml") = 0; // ML, MPE, MMI 05340 virtual bool BSAPI_METHOD SetAccumType(const char *pType = "ml") = 0; // ML, MPI, MMI, MCE, MFE 05341 virtual bool BSAPI_METHOD SetUpdateMode(const char *pMode = "update") = 0; // UPDATE, DUMP, BOTH 05342 05343 virtual bool BSAPI_METHOD SetSinglePassTrn(bool singlePassTrn = false) = 0; 05344 05345 // network expansion and optimization parameters 05346 virtual void BSAPI_METHOD SetRespectPronunVar(bool respectPronunVar = false) = 0; 05347 virtual void BSAPI_METHOD SetCDPhoneExpansion(bool cdPhoneExpansion = false) = 0; 05348 virtual void BSAPI_METHOD SetStrictTiming(bool strictTiming = false) = 0; 05349 virtual void BSAPI_METHOD SetNoOptimization(bool noOptimization = true) = 0; 05350 virtual void BSAPI_METHOD SetRemoveWordNodes(bool removeWordNodes = false) = 0; 05351 05352 // input formats and files 05353 virtual void BSAPI_METHOD SetStartTimeShift(double startTimeShift = 0.0) = 0; 05354 virtual void BSAPI_METHOD SetEndTimeShift(double endTimeShift = 0.0) = 0; 05355 virtual bool BSAPI_METHOD SetInTranscFmt(const char *pFmt = "htk") = 0; 05356 virtual void BSAPI_METHOD SetXfStatBin(bool xfStatBin = false) = 0; 05357 virtual void BSAPI_METHOD SetNetworkFile(const char *pNetworkFile = "none") = 0; 05358 virtual void BSAPI_METHOD SetStatFile(const char *pStatFile = "none") = 0; 05359 virtual void BSAPI_METHOD SetSrcMlf(const char *pSrcMlf = "none") = 0; 05360 virtual void BSAPI_METHOD SetXformList(const char *pXformList = "none") = 0; 05361 05362 // output formats and files 05363 virtual void BSAPI_METHOD SetTrgHmmDir(const char *trgHmmDir = "none") = 0; 05364 virtual void BSAPI_METHOD SetSaveGlobalOpt(bool saveGlobalOpt = true) = 0; 05365 05366 // prunings 05367 virtual void BSAPI_METHOD SetTimePruning(bool timePruning = false) = 0; 05368 virtual void BSAPI_METHOD SetStatePruning(double statePruning = 0.0) = 0; 05369 virtual void BSAPI_METHOD SetStatePruningStep(double statePruningStep = 0.0) = 0; 05370 virtual void BSAPI_METHOD SetStatePruningLimit(double statePruningLimit = 0.0) = 0; 05371 05372 // training parameters 05373 virtual void BSAPI_METHOD SetViterbiTrain(bool viterbiTrain = false) = 0; 05374 virtual void BSAPI_METHOD SetGrammarScale(double grammarScale = 1.0) = 0; 05375 virtual void BSAPI_METHOD SetOutPrbScale(double outPrbScale = 1.0) = 0; 05376 virtual void BSAPI_METHOD SetTranspScale(double transpScale = 1.0) = 0; 05377 virtual void BSAPI_METHOD SetPronunScale(double pronunScale = 1.0) = 0; 05378 virtual void BSAPI_METHOD SetOccPrbScale(double occPrbScale = 1.0) = 0; 05379 virtual void BSAPI_METHOD SetWordPenalty(double wordPenalty = 0.0) = 0; 05380 virtual void BSAPI_METHOD SetModelPenalty(double modelPenalty = 0.0) = 0; 05381 virtual void BSAPI_METHOD SetMaxActive(int maxActive = 0) = 0; 05382 virtual void BSAPI_METHOD SetMinActive(int minActive = 0) = 0; 05383 virtual void BSAPI_METHOD SetMinExamples(int minExamples = 3) = 0; 05384 virtual void BSAPI_METHOD SetMinVariance(double minVariance = 0.0) = 0; 05385 virtual void BSAPI_METHOD SetMinMaxWght(double minMaxWght = 1.0) = 0; 05386 virtual void BSAPI_METHOD SetCmllrStats(bool cmllrStats = false) = 0; 05387 virtual void BSAPI_METHOD SetCmllrStatsMinFrames(int minFrames = 0) = 0; 05388 virtual void BSAPI_METHOD SetNFrameOutNorm(bool nFrameOutNorm = false) = 0; 05389 virtual void BSAPI_METHOD SetSigSlope(double sigSlope = -1.0) = 0; 05390 virtual void BSAPI_METHOD SetEConstant(double eConstant = 2.0) = 0; 05391 virtual void BSAPI_METHOD SetHConstant(double hConstant = 2.0) = 0; 05392 virtual void BSAPI_METHOD SetISmoothing(double iSmoothing = 200.0) = 0; 05393 virtual void BSAPI_METHOD SetJSmoothing(bool jSmoothing = false) = 0; 05394 virtual void BSAPI_METHOD SetMAPTau(double mAPTau = 10.0) = 0; 05395 virtual void BSAPI_METHOD SetMinOccup(double minOccup = 0.0) = 0; 05396 virtual void BSAPI_METHOD SetIMaxOccup(double iMaxOccup = -1.0) = 0; 05397 virtual void BSAPI_METHOD SetAlgMixtures(bool algMixtures = false) = 0; 05398 virtual double BSAPI_METHOD GetTotLogLike() = 0; 05399 virtual int BSAPI_METHOD GetTotNFrames() = 0; 05400 }; 05401 05405 class SGMMPreselectionTableI : public SUnknownI 05406 { 05407 public: 05408 virtual bool BSAPI_METHOD Load(const char *pFile) = 0; 05409 05410 virtual int BSAPI_METHOD GetNClusters() = 0; 05411 virtual int BSAPI_METHOD GetNMixtures() = 0; 05412 05413 virtual int ** BSAPI_METHOD GetClusters() = 0; 05414 virtual int * BSAPI_METHOD GetClusterLengths() = 0; 05415 05416 virtual void BSAPI_METHOD Dump() = 0; 05417 }; 05418 05422 class SGMMI : public SUnknownI 05423 { 05424 public: 05431 virtual bool BSAPI_METHOD Init(int nMixtures = 0, int vectorSize = 0, unsigned int modelParts = GMMP_MEANS | GMMP_VARIANCES | GMMP_WEIGHTS) = 0; 05435 virtual unsigned int BSAPI_METHOD GetModelParts() = 0; 05439 virtual bool BSAPI_METHOD Save(const char *pFile) = 0; 05440 virtual bool BSAPI_METHOD Load(const char *pFile, unsigned int additionalModelParts = 0) = 0; 05441 virtual bool BSAPI_METHOD Assign(SGMMI *pGmm) = 0; 05442 05443 virtual void BSAPI_METHOD SetUBM(SGMMI *pUBM) = 0; 05444 virtual void BSAPI_METHOD SetGaussianSelectionModel(SGMMI *pGaussianSelectionModel) = 0; 05445 virtual void BSAPI_METHOD SetGaussianSelectionClusters(SGMMPreselectionTableI *pGaussianSelectionClusters) = 0; 05446 05447 virtual void BSAPI_METHOD SetScoringMethod(unsigned int scoringMethod) = 0; 05448 virtual unsigned int BSAPI_METHOD GetScoringMethod() = 0; 05449 virtual void BSAPI_METHOD SetEstimationFlags(unsigned int reestimateFlags) = 0; 05450 virtual unsigned int BSAPI_METHOD GetEstimationFlags() = 0; 05451 05452 virtual void BSAPI_METHOD SetMapTau(float mapTau) = 0; 05453 virtual float BSAPI_METHOD GetMapTau() = 0; 05454 virtual void BSAPI_METHOD SetNBest(int nBest) = 0; 05455 virtual int BSAPI_METHOD GetNBest() = 0; 05456 05457 virtual void BSAPI_METHOD SetUserFlags(unsigned int userFlags) = 0; 05458 virtual unsigned int BSAPI_METHOD GetUserFlags() = 0; 05459 05460 virtual void BSAPI_METHOD SetDefaultPassFlags(unsigned int defaultPassFlags) = 0; 05461 05462 virtual bool BSAPI_METHOD EvaluateGaussians(SFloatMatrixI *pFeatures, int nFrames, bool allGaussians) = 0; 05463 05464 virtual bool BSAPI_METHOD ScoreFrames(SFloatMatrixI *pFeatures, int nFrames, float *pSummedScore, float *pRetScores = 0) = 0; 05465 virtual bool BSAPI_METHOD AddFeaturesForTest(SFloatMatrixI *pFeatures, int nFrames, int pass, unsigned int flags) = 0; 05466 virtual bool BSAPI_METHOD GetScore(float *pRetScore) = 0; 05467 05468 virtual bool BSAPI_METHOD AddFeaturesForTraining(SFloatMatrixI *pFeatures, int nFrames, int pass, unsigned int flags) = 0; 05469 virtual bool BSAPI_METHOD Reestimate() = 0; 05470 05471 virtual void BSAPI_METHOD ResetAccums() = 0; 05472 virtual void BSAPI_METHOD ResetPerSentenceAccums() = 0; 05473 05474 virtual int BSAPI_METHOD GetNMixtures() = 0; 05475 virtual int BSAPI_METHOD GetVectorSize() = 0; 05476 virtual int BSAPI_METHOD GetExtendedVectorSize() = 0; 05477 virtual SGMMI * BSAPI_METHOD GetUBM() = 0; 05478 virtual SFloatMatrixI * BSAPI_METHOD GetGaussianLogLikes() = 0; 05479 virtual bool BSAPI_METHOD GetAllGaussiansEvaluated() = 0; 05480 05481 virtual float * BSAPI_METHOD GetMeans() = 0; 05482 virtual float * BSAPI_METHOD GetAdaptedMeans() = 0; 05483 virtual float * BSAPI_METHOD GetInvVariances() = 0; 05484 virtual float * BSAPI_METHOD GetLogWeights() = 0; 05485 virtual float * BSAPI_METHOD GetGConsts() = 0; 05486 virtual float * BSAPI_METHOD GetZStats() = 0; 05487 virtual float * BSAPI_METHOD GetOccupations() = 0; 05488 virtual float * BSAPI_METHOD GetXStats() = 0; 05489 virtual float * BSAPI_METHOD GetX2Stats() = 0; 05490 virtual float * BSAPI_METHOD GetSentOccupations() = 0; 05491 virtual float * BSAPI_METHOD GetSentXStats() = 0; 05492 virtual float * BSAPI_METHOD GetSentX2Stats() = 0; 05493 05494 virtual int BSAPI_METHOD GetNFramesInSentence() = 0; 05495 virtual int BSAPI_METHOD GetNTrainingFrames() = 0; 05496 05497 virtual SIntMatrixI * BSAPI_METHOD GetNBestIndexes() = 0; 05498 virtual void BSAPI_METHOD SetNBestIndexes(SIntMatrixI *pNBestIndexes) = 0; 05499 virtual void BSAPI_METHOD SetUsePerSentenceNBestIndexes(bool usePerSentenceNBestIndexes) = 0; 05500 virtual bool BSAPI_METHOD GetUsePerSentenceNBestIndexes() = 0; 05501 05502 virtual bool BSAPI_METHOD SetFactorAnalysis(SFactorAnalysisI *pFactorAnalysis) = 0; 05503 virtual SFactorAnalysisI * BSAPI_METHOD GetFactorAnalysis() = 0; 05504 virtual SFactorsI * BSAPI_METHOD GetFactors() = 0; 05505 05506 virtual void BSAPI_METHOD SetUseAdaptedModel(bool useAdaptedModel) = 0; 05507 virtual bool BSAPI_METHOD GetUseAdaptedModel() = 0; 05508 05509 virtual void BSAPI_METHOD Backup() = 0; 05510 virtual bool BSAPI_METHOD Restore() = 0; 05511 virtual void BSAPI_METHOD DestroyBackup() = 0; 05512 }; 05513 05517 class SGMMListI : public SUnknownI, public SFeatureExtractionCallbackI 05518 { 05519 public: 05520 // model setting 05521 virtual bool BSAPI_METHOD SetFactorAnalysis(SFactorAnalysisI *pFactorAnalysis) = 0; 05522 virtual void BSAPI_METHOD SetScoringMethod(unsigned int scoringMethod) = 0; // bs:exclude 05523 virtual bool BSAPI_METHOD SetScoringMethodStr(const char *pScoringMethod = "per_frame") = 0; 05524 virtual void BSAPI_METHOD SetModelParts(unsigned int modelParts) = 0; // bs:exclude 05525 virtual bool BSAPI_METHOD SetModelPartsStr(const char *pModelParts = "means;variances;weights") = 0; 05526 virtual void BSAPI_METHOD SetEstimationFlags(unsigned int estimationFlags) = 0; // bs:exclude 05527 virtual bool BSAPI_METHOD SetEstimationFlagsStr(const char *pEstimationFlags = "means;variances;weights") = 0; 05528 virtual void BSAPI_METHOD SetMapTau(float mapTau = 0.0f) = 0; // Relevance factor for MAP adaptation 05529 virtual void BSAPI_METHOD SetNBest(int nBest = 0) = 0; 05530 05531 // default parameters for new model 05532 virtual void BSAPI_METHOD SetDefaultVectorSize(int defaultVectorSize = 1) = 0; 05533 virtual void BSAPI_METHOD SetDefaultNMixtures(int defaultNMixtures = 1) = 0; 05534 05535 // processing of feature vectors 05536 virtual void BSAPI_METHOD SetBatchSize(int batchSize = 16) = 0; 05537 virtual void BSAPI_METHOD SetFrameStride(int frameStride = 1) = 0; 05538 virtual int BSAPI_METHOD GetFrameStride() = 0; 05539 05540 // add or create and add new model to the list 05541 virtual bool BSAPI_METHOD AddModel(const char *pName, SGMMI *pModel) = 0; 05542 virtual SGMMI * BSAPI_METHOD CreateModel(const char *pName) = 0; // bs:include bs:only_if_set 05543 05544 // only active models are scored 05545 virtual bool BSAPI_METHOD SetActiveModels(const char *pActiveModels) = 0; // bs:include bs:only_if_set 05546 05547 // model reestimation 05548 virtual void BSAPI_METHOD StartEstimation() = 0; 05549 virtual void BSAPI_METHOD SetModelName(const char *pModelName) = 0; 05550 virtual bool BSAPI_METHOD AddFeaturesForTraining(const char *pModelName, SFloatMatrixI *pFeatures, int nFrames, unsigned int flags = PF_LASTFRAME | PF_OFFLINEPROC) = 0; 05551 virtual bool BSAPI_METHOD Reestimate() = 0; 05552 05553 // scoring of frames ore sentences 05554 virtual bool BSAPI_METHOD ScoreFrames(SFloatMatrixI *pFeatures, int nFrames, SFloatMatrixI *pRetSummedScores, SFloatMatrixI*pRetScores = 0, int *pNRetFrames = 0 ) = 0; 05555 virtual bool BSAPI_METHOD AddFeaturesForTest(SFloatMatrixI *pFeatures, int nFrames, unsigned int flags = PF_LASTFRAME | PF_OFFLINEPROC) = 0; 05556 virtual float * BSAPI_METHOD GetModelScores(int *pNumValues = 0) = 0; 05557 virtual char ** BSAPI_METHOD GetModelNames(int *pNumValues = 0) = 0; 05558 virtual const char * BSAPI_METHOD GetBestModel(float *pScore = 0) = 0; 05559 virtual int * BSAPI_METHOD GetTrainingLengths(int *pNumValues = 0) = 0; 05560 05561 // get number of feature vectors accumulated in the buffer 05562 virtual int BSAPI_METHOD GetNFrames() = 0; 05563 05564 // reset accums for training or test 05565 virtual void BSAPI_METHOD ResetAccums() = 0; 05566 05567 // remove/release/rename models 05568 virtual bool BSAPI_METHOD RemoveModel(const char *pName) = 0; 05569 virtual void BSAPI_METHOD RemoveAllModels() = 0; 05570 05571 virtual bool BSAPI_METHOD ReleaseModel(const char *pName) = 0; 05572 virtual void BSAPI_METHOD ReleaseAllModels() = 0; 05573 05574 virtual bool BSAPI_METHOD RenameModel(const char *pOldName, const char *pNewName) = 0; 05575 05576 // accessors 05577 virtual int BSAPI_METHOD GetNModels() = 0; 05578 virtual void BSAPI_METHOD FirstModel() = 0; 05579 virtual SGMMI * BSAPI_METHOD GetModel() = 0; 05580 virtual SGMMI * BSAPI_METHOD GetModelByName(const char *pName) = 0; 05581 05582 // model existence 05583 virtual bool BSAPI_METHOD ModelExists(const char *pName) = 0; 05584 05585 // backup 05586 virtual void BSAPI_METHOD BackupModels() = 0; 05587 virtual bool BSAPI_METHOD RestoreModels() = 0; 05588 virtual void BSAPI_METHOD DestroyBackup() = 0; 05589 05590 // model setting and loading that must be done at the end in blockset 05591 virtual void BSAPI_METHOD SetUBM(SGMMI *pUBM = 0) = 0; 05592 virtual SGMMI * BSAPI_METHOD GetUBM() = 0; 05593 virtual bool BSAPI_METHOD LoadUBM(const char *pFile) = 0; // bs:include bs:only_if_set 05594 virtual void BSAPI_METHOD SetUBMName(const char *pUBMName = "ubm") = 0; 05595 05596 virtual void BSAPI_METHOD SetGaussianSelectionModel(SGMMI *pGaussianSelectionModel) = 0; 05597 virtual bool BSAPI_METHOD LoadGaussianSelectionModel(const char *pFile) = 0; // bs:include bs:only_if_set 05598 virtual void BSAPI_METHOD SetGaussianSelectionClusters(SGMMPreselectionTableI *pGaussianSelectionClusters) = 0; 05599 virtual bool BSAPI_METHOD LoadGaussianSelectionClusters(const char *pFile) = 0; // bs:include bs:only_if_set 05600 virtual void BSAPI_METHOD SetGaussianSelectionNBest(int gaussianSelectionNBest = 0) = 0; 05601 05602 // load/save model 05603 virtual bool BSAPI_METHOD LoadModelsFromList(const char *pList) = 0; // bs:include bs:only_if_set 05604 virtual bool BSAPI_METHOD LoadModelsFromDir(const char *pDirectory, const char *pSuffix) = 0; 05605 05606 virtual bool BSAPI_METHOD SaveModels(const char *pDirectory, const char *pSuffix, bool newModelsOnly = false) = 0; 05607 05608 virtual void BSAPI_METHOD SetTarget(SScoreCallbackI *pTarget) = 0; 05609 }; 05610 05616 class SFactorAnalysisI : public SUnknownI 05617 { 05618 public: 05619 virtual bool BSAPI_METHOD CreateFactors(SFactorsI **ppFactors) = 0; 05620 05621 virtual const unsigned int * BSAPI_METHOD GetTestPasses(int *pRetNPasses = 0) = 0; 05622 virtual const unsigned int * BSAPI_METHOD GetTrainingPasses(int *pRetNPasses = 0) = 0; 05623 05624 virtual unsigned int BSAPI_METHOD GetModelParts() = 0; 05625 virtual unsigned int BSAPI_METHOD GetUBMModelParts() = 0; 05626 05627 virtual bool BSAPI_METHOD Reestimate(SGMMI *pGMM) = 0; 05628 virtual bool BSAPI_METHOD SynthetizeForTest(SGMMI *pGMM) = 0; 05629 virtual float BSAPI_METHOD GetScore(SGMMI *pGMM) = 0; 05630 }; 05631 05634 class SEigenChannelsFAI : public SFactorAnalysisI 05635 { 05636 public: 05637 virtual void BSAPI_METHOD SetEstimateByUBMOnly(bool estimateByUBMOnly = true) = 0; 05638 virtual void BSAPI_METHOD SetNBest(int nBest = 0) = 0; 05639 05640 virtual bool BSAPI_METHOD LoadEigenchannelMatrix(const char *pFile) = 0; // bs:include bs:only_if_set 05641 virtual bool BSAPI_METHOD LoadVViMatrix(const char *pFile) = 0; // bs:include bs:only_if_set 05642 }; 05643 05652 class SESpeakersEChannelsFAI : public SFactorAnalysisI 05653 { 05654 }; 05655 05660 class SFactorsI : public SUnknownI 05661 { 05662 public: 05663 virtual void * BSAPI_METHOD GetData(int *pLength) = 0; 05664 virtual bool BSAPI_METHOD SetData(void *pData, int length) = 0; 05665 virtual bool BSAPI_METHOD Assign(SFactorsI *pFactors) = 0; 05666 }; 05667 05670 class SSpeakerChannelFactorsI : public SFactorsI 05671 { 05672 public: 05673 virtual float * BSAPI_METHOD GetSpeakerFactorVector(int *pLength = 0) = 0; 05674 05675 virtual bool BSAPI_METHOD SetDimensions(int speakerDim) = 0; 05676 }; 05677 05680 class STwoSetComparisonI : public SUnknownI 05681 { 05682 public: 05683 virtual bool BSAPI_METHOD Compare2Sets(SFloatMatrixI *pSet1, SFloatMatrixI *pSet2, SFloatMatrixI *pRetScores) = 0; 05684 }; 05685 05691 class STwoCovarianceModelI : public STwoSetComparisonI 05692 { 05693 public: 05694 virtual void BSAPI_METHOD SetWithinClassCovariance(const char *pFile) = 0; 05695 virtual void BSAPI_METHOD SetAcrossClassCovariance(const char *pFile) = 0; 05696 virtual void BSAPI_METHOD SetMean(const char *pFile) = 0; 05697 05698 virtual void BSAPI_METHOD SetRMatrix(const char *pFile) = 0; 05699 virtual void BSAPI_METHOD SetSMatrix(const char *pFile) = 0; 05700 virtual void BSAPI_METHOD SetTMatrix(const char *pFile) = 0; 05701 virtual void BSAPI_METHOD SetUMatrix(const char *pFile) = 0; 05702 05703 virtual bool BSAPI_METHOD SetCovMatrixFileFormat(const char *pMatrixFileFormat = "htk") = 0; 05704 virtual bool BSAPI_METHOD SetRstuMatrixFileFormat(const char *pMatrixFileFormat = "htk") = 0; 05705 05706 virtual void BSAPI_METHOD SetClearWorkplace(bool clearWorkplace = true) = 0; 05707 virtual void BSAPI_METHOD SetSaveRstuMatrices(bool saveRSTUMatrices = false) = 0; 05708 }; 05709 05716 class SSignalModellingSubsystemI : public SUnknownI, public SWaveformSourceCallbackI, public STransCallbackI 05717 { 05718 public: 05719 virtual bool BSAPI_METHOD Init(const char *pConfigFile) = 0; 05720 05721 virtual bool BSAPI_METHOD SetModelDirectory(const char *pModelDirectory) = 0; 05722 virtual char * BSAPI_METHOD GetModelDirectory() = 0; 05723 05724 virtual int BSAPI_METHOD GetNRequestedTrainingIters() = 0; 05725 virtual bool BSAPI_METHOD StartTrainingIteration() = 0; 05726 virtual bool BSAPI_METHOD SetModelName(const char *pModelName) = 0; 05727 virtual bool BSAPI_METHOD FinishTraining() = 0; 05728 05729 virtual bool BSAPI_METHOD ActivateModels(const char *pList) = 0; 05730 virtual bool BSAPI_METHOD BackupModels() = 0; 05731 virtual bool BSAPI_METHOD RestoreModels() = 0; 05732 05733 virtual bool BSAPI_METHOD ResetTest() = 0; 05734 virtual bool BSAPI_METHOD SetActiveWaveformPart(float startInSec = 0.0f, float lenInSec = 0.0f) = 0; 05735 05736 virtual float * BSAPI_METHOD GetModelScores(int *pNumValues) = 0; 05737 virtual char ** BSAPI_METHOD GetModelNames(int *pNumValues) = 0; 05738 05739 virtual bool BSAPI_METHOD Cancel() = 0; 05740 05741 virtual void BSAPI_METHOD SetSaveTemporalFiles(bool saveTemporalFiles) = 0; 05742 virtual void BSAPI_METHOD SetTemporalFileName(const char *pName) = 0; 05743 virtual void BSAPI_METHOD SetOverwriteFiles(bool overwriteFiles) = 0; 05744 05745 virtual bool BSAPI_METHOD RemoveModel(const char *pName) = 0; 05746 virtual bool BSAPI_METHOD RenameModel(const char *pOldName, const char *pNewName) = 0; 05747 05748 virtual void BSAPI_METHOD SetSignalModellingDock(SSignalModellingI *pSignalModelling) = 0; 05749 }; 05750 05753 class SPhonotacticSMSubsystemI : public SSignalModellingSubsystemI 05754 { 05755 public: 05756 virtual bool BSAPI_METHOD AddFeatures(const char *pModelName, SFloatMatrixI *pFeatures, int nFrames, segm_pos_type *pSegments, int nSegments) = 0; 05757 }; 05758 05761 class SAcousticSMSubsystemI : public SSignalModellingSubsystemI 05762 { 05763 public: 05764 virtual SBlockSetI * BSAPI_METHOD GetBlockSet() = 0; 05765 /* 05766 virtual void BSAPI_METHOD SetGMMFileSuffix(char *pSuffix) = 0; 05767 virtual void BSAPI_METHOD SetMacroFileSuffix(char *pSuffix) = 0; 05768 virtual char * BSAPI_METHOD GetGMMFileSuffix() = 0; 05769 virtual char * BSAPI_METHOD GetMacroFileSuffix() = 0; 05770 */ 05771 }; 05772 05777 class SModelListI : public SUnknownI 05778 { 05779 public: 05784 virtual bool BSAPI_METHOD SetModelDirectory(const char *pModelDirectory = "") = 0; // bs:only_if_set 05788 virtual char * BSAPI_METHOD GetModelDirectory() = 0; 05792 virtual void BSAPI_METHOD SetModelFileSuffix(const char *pModelFileSuffix = "") = 0; 05798 virtual void BSAPI_METHOD SetListName(const char *pListName = "") = 0; // bs:only_if_set 05802 virtual char * BSAPI_METHOD GetListName() = 0; 05806 virtual int BSAPI_METHOD GetNRequestedTrainingIters() = 0; 05810 virtual bool BSAPI_METHOD StartTrainingIteration() = 0; 05814 virtual bool BSAPI_METHOD SetModelName(const char *pModelName = "") = 0; // bs:only_if_set 05818 virtual bool BSAPI_METHOD FinishTraining() = 0; 05822 virtual bool BSAPI_METHOD Cancel() = 0; 05829 virtual bool BSAPI_METHOD ActivateModels(const char *pList) = 0; 05835 virtual bool BSAPI_METHOD ActivateAllModels() = 0; 05838 virtual int BSAPI_METHOD GetNModels() = 0; 05843 virtual bool BSAPI_METHOD RemoveModel(const char *pName) = 0; 05849 virtual bool BSAPI_METHOD RenameModel(const char *pOldName, const char *pNewName) = 0; 05853 virtual bool BSAPI_METHOD BackupModels() = 0; 05857 virtual bool BSAPI_METHOD RestoreModels() = 0; 05861 virtual void BSAPI_METHOD SetTarget(SScoreCallbackI *pTarget) = 0; 05862 }; 05863 05868 class SGMMModelListI : public SModelListI, public SFeatureExtractionCallbackI 05869 { 05870 public: 05871 virtual void BSAPI_METHOD SetGmmList(SGMMListI *pGMMList) = 0; 05872 }; 05873 05878 class SVoicePrintModelListI : public SModelListI, public SParametersCallbackI 05879 { 05880 public: 05881 virtual void BSAPI_METHOD SetVoicePrintComparator(SVoicePrintComparatorI *pVoicePrintComparator) = 0; 05882 }; 05883 05888 class SNGramPhonotacticModelListI : public SModelListI, public STransCallbackI 05889 { 05890 public: 05891 virtual void BSAPI_METHOD SetUBMFile(const char *pUBMFile = "") = 0; // bs:only_if_set 05892 virtual void BSAPI_METHOD SetUBMName(const char *pUBMName = "ubm") = 0; 05893 virtual void BSAPI_METHOD SetUBMAdaptConst(float ubmAdaptConst = 2.0f) = 0; 05894 05895 virtual void BSAPI_METHOD SetLab2IntFile(const char *pLab2IntFile = "") = 0; // bs:only_if_set 05896 virtual void BSAPI_METHOD SetConvertFilesToBinaryFormat(bool convertFilesToBinaryFormat = true) = 0; 05897 05898 virtual void BSAPI_METHOD SetMaxNGramOrder(int maxNGramOrder = 3) = 0; 05899 virtual void BSAPI_METHOD SetNormalizeByNNGrams(bool normalizeByNNGrams = true) = 0; 05900 }; 05901 05906 class SIVectorModelListI : public SModelListI 05907 { 05908 public: 05909 }; 05910 05915 class SScoresI : public SUnknownI 05916 { 05917 public: 05918 typedef enum 05919 { 05920 bnmUnknown, 05921 bnmMax, 05922 bnmMin 05923 } best_name_method_type; 05924 05925 typedef enum 05926 { 05927 bgdmUnknown, 05928 bgdmPosteriorProbability, 05929 bgdmLLR 05930 } bg_det_method_type; 05931 05932 virtual char * BSAPI_METHOD GetRecordName() = 0; 05933 virtual bool BSAPI_METHOD SetRecordName(const char *pRecordName) = 0; 05934 05935 virtual bool BSAPI_METHOD Init(int nScores) = 0; 05936 virtual int BSAPI_METHOD GetNScores() = 0; 05937 05938 virtual char ** BSAPI_METHOD GetNames() = 0; 05939 virtual char ** BSAPI_METHOD GetExtendedNames() = 0; 05940 virtual float * BSAPI_METHOD GetScores() = 0; 05941 virtual float * BSAPI_METHOD GetExtendedScores() = 0; // background score + model scores 05942 virtual float * BSAPI_METHOD GetTrainingLengths() = 0; 05943 virtual float * BSAPI_METHOD GetExtendedTrainingLengths() = 0; 05944 05945 virtual const char * BSAPI_METHOD GetBackgroundName() = 0; 05946 virtual bool BSAPI_METHOD SetBackgroundName(const char *pBackgroundName) = 0; 05947 virtual float BSAPI_METHOD GetBackgroundScore() = 0; 05948 virtual void BSAPI_METHOD SetBackgroundScore(float backgroundScore) = 0; 05949 virtual float BSAPI_METHOD GetBackgroundTrainingLength() = 0; 05950 virtual void BSAPI_METHOD SetBackgroundTrainingLength(float backgroundTrainingLength) = 0; 05951 05952 virtual char * BSAPI_METHOD GetName(int index) = 0; 05953 virtual bool BSAPI_METHOD SetName(int index, const char *pName) = 0; 05954 virtual float BSAPI_METHOD GetScore(int index) = 0; 05955 virtual bool BSAPI_METHOD SetScore(int index, float score) = 0; 05956 05957 virtual char * BSAPI_METHOD GetBestName(float *pRetBestScore = 0) = 0; 05958 virtual void BSAPI_METHOD SetBestNameMethod(best_name_method_type bestNameMethod) = 0; 05959 virtual best_name_method_type BSAPI_METHOD GetBestNameMethod() = 0; 05960 virtual bool BSAPI_METHOD SetBestNameMethodStr(const char *pBestNameMethod) = 0; 05961 05962 virtual void BSAPI_METHOD SetUseBackground(bool useBackground) = 0; 05963 virtual void BSAPI_METHOD SetBackgroundDetectionMethod(bg_det_method_type backgroundDetectionMethod) = 0; 05964 virtual bg_det_method_type BSAPI_METHOD GetBackgroundDetectionMethod() = 0; 05965 virtual bool BSAPI_METHOD SetBackgroundDetectionMethodStr(const char *pBackgroundDetectionMethodStr) = 0; 05966 05967 virtual float BSAPI_METHOD GetTrainingLength(int index) = 0; 05968 virtual bool BSAPI_METHOD SetTrainingLength(int index, float length) = 0; 05969 virtual float BSAPI_METHOD GetTestLength() = 0; 05970 virtual void BSAPI_METHOD SetTestLength(float length) = 0; 05971 05972 virtual bool BSAPI_METHOD GetIsLast() = 0; 05973 virtual void BSAPI_METHOD SetIsLast(bool isLast) = 0; 05974 05975 virtual bool BSAPI_METHOD Assign(SScoresI *pScores) = 0; 05976 }; 05977 05981 class SScoreMemoryI : public SUnknownI, public SScoreCallbackI 05982 { 05983 public: 05984 virtual void BSAPI_METHOD SetTarget(SScoreCallbackI *pTarget) = 0; 05985 virtual SScoresI * BSAPI_METHOD GetScores() = 0; 05986 virtual bool BSAPI_METHOD Send() = 0; 05987 virtual bool BSAPI_METHOD Empty() = 0; 05988 }; 05989 05995 class SScoreNodeI : public SUnknownI, public SScoreCallbackI 05996 { 05997 public: 05998 virtual void BSAPI_METHOD SetTarget(SScoreCallbackI *pTarget) = 0; 05999 }; 06000 06005 class SScoreTransformI : public SUnknownI, public SScoreCallbackI 06006 { 06007 public: 06008 virtual void BSAPI_METHOD SetTarget(SScoreCallbackI *pTarget) = 0; 06009 virtual bool BSAPI_METHOD SetDivideByTestSentenceLength(bool divideByTestSentenceLength = true) = 0; 06010 virtual void BSAPI_METHOD SetScoreScale(float scale = 1.0f) = 0; 06011 virtual void BSAPI_METHOD SetBgScoreScale(float bgScoreScale = 1.0f) = 0; 06012 virtual bool BSAPI_METHOD SetTransform(const char *pTransform = "Raw") = 0; 06013 virtual void BSAPI_METHOD SetUseInputScores(bool useInputScores = false) = 0; 06014 }; 06015 06020 class SScoreMergerI : public SUnknownI, public SScoreCallbackI 06021 { 06022 public: 06023 virtual void BSAPI_METHOD SetTarget(SScoreCallbackI *pTarget) = 0; 06024 }; 06025 06030 class SPieceWiseScoreScaleI : public SUnknownI, public SScoreCallbackI 06031 { 06032 public: 06033 virtual void BSAPI_METHOD SetTarget(SScoreCallbackI *pTarget) = 0; 06034 virtual bool BSAPI_METHOD LoadScaleMatrix(const char *pFile) = 0; // bs:include bs:only_if_set 06035 virtual bool BSAPI_METHOD LoadShiftMatrix(const char *pFile) = 0; // bs:include bs:only_if_set 06036 }; 06037 06040 class STwoSetPieceWiseScoreScaleI : public SUnknownI 06041 { 06042 public: 06043 06052 virtual bool BSAPI_METHOD ScaleScores(SFloatMatrixI *pScores, float *pSet1Lengths, float *pSet2Lengths) = 0; 06053 06054 virtual bool BSAPI_METHOD LoadScaleMatrix(const char *pFile) = 0; // bs:include bs:only_if_set 06055 virtual bool BSAPI_METHOD LoadShiftMatrix(const char *pFile) = 0; // bs:include bs:only_if_set 06056 }; 06057 06076 class SSignalModellingI : public SUnknownI, public SWaveformSourceCallbackI 06077 { 06078 public: 06083 virtual bool BSAPI_METHOD Init(const char *pConfigFile) = 0; 06084 06091 virtual bool BSAPI_METHOD SetMode(unsigned int mode) = 0; 06095 virtual unsigned int BSAPI_METHOD GetMode() = 0; 06096 06101 virtual bool BSAPI_METHOD SetModelDirectory(const char *pModelDirectory) = 0; 06105 virtual char * BSAPI_METHOD GetModelDirectory() = 0; 06109 virtual int BSAPI_METHOD GetNRequestedTrainingIters() = 0; 06114 virtual bool BSAPI_METHOD StartTrainingIteration() = 0; 06123 virtual bool BSAPI_METHOD AddWaveform(const char *pModelName, void *pWaveform, int nBytes, unsigned int flags = PF_LASTFRAME | PF_OFFLINEPROC) = 0; 06130 virtual bool BSAPI_METHOD AddFile(const char *pModelName, const char *pFile) = 0; 06135 virtual bool BSAPI_METHOD AddFilesFromListFile(const char *pListFile) = 0; 06140 virtual bool BSAPI_METHOD AddFilesFromMemList(const char *pMemList) = 0; 06147 virtual bool BSAPI_METHOD AddFilesFromDirectory(const char *pModelName, const char *pDirectory, const char *pSuffix) = 0; 06151 virtual bool BSAPI_METHOD FinishTraining() = 0; 06152 06159 virtual bool BSAPI_METHOD ActivateModels(const char *pList) = 0; 06164 virtual bool BSAPI_METHOD ActivateAllModels() = 0; 06176 virtual bool BSAPI_METHOD TestWaveform(void *pWaveform, int nBytes, unsigned int flags = PF_LASTFRAME | PF_OFFLINEPROC) = 0; 06182 virtual bool BSAPI_METHOD ResetTest() = 0; 06188 virtual bool BSAPI_METHOD TestFile(const char *pFile) = 0; 06198 virtual bool BSAPI_METHOD SetActiveWaveformPart(float startInSec, float lenInSec) = 0; 06207 virtual void BSAPI_METHOD SetTwoStageProcessing(bool twoStageProcessing) = 0; 06211 virtual bool BSAPI_METHOD RunSecondStage() = 0; 06218 virtual float * BSAPI_METHOD GetModelScores(int *pNumValues) = 0; 06225 virtual char ** BSAPI_METHOD GetModelNames(int *pNumValues) = 0; 06232 virtual char * BSAPI_METHOD GetBestModel(float *pScore = 0) = 0; 06241 virtual void BSAPI_METHOD SetUseOtherClass(bool useOtherClass) = 0; 06245 virtual void BSAPI_METHOD Cancel() = 0; 06252 virtual void BSAPI_METHOD SetSaveTemporalFiles(bool saveTemporalFiles) = 0; 06261 virtual void BSAPI_METHOD SetOverwriteFiles(bool overwriteFiles) = 0; 06267 virtual float BSAPI_METHOD GetTestLength() = 0; 06272 virtual float BSAPI_METHOD GetTrainingLength(const char *pModelName) = 0; 06280 virtual void BSAPI_METHOD SetTemporalFileName(const char *pName) = 0; 06285 virtual bool BSAPI_METHOD RemoveModel(const char *pName) = 0; 06291 virtual bool BSAPI_METHOD RenameModel(const char *pOldName, const char *pNewName) = 0; 06292 06299 virtual char ** BSAPI_METHOD GetSubsysNames(int *pNumNames = 0) = 0; 06309 virtual void BSAPI_METHOD SetSubsysWeights(float *pWeights) = 0; 06314 virtual float * BSAPI_METHOD GetSubsysWeights(int *pNumWeights = 0) = 0; 06315 06320 virtual SSignalModellingSubsystemI * BSAPI_METHOD GetSubsystem(const char *pName) = 0; 06321 06329 virtual void BSAPI_METHOD SetMasterSignalModelling(SSignalModellingI *pMasterSignalModelling) = 0; 06330 06340 virtual bool BSAPI_METHOD SetUseWaveformFilter(bool useWaveformFilter = false) = 0; 06348 virtual SWaveformFormatConvertorI * BSAPI_METHOD GetWaveformFormatConvertor() = 0; 06354 virtual SWaveformMemoryI * BSAPI_METHOD GetWaveformMemory() = 0; 06359 virtual STranscriptionMemoryI * BSAPI_METHOD GetTranscriptionMemory() = 0; 06364 virtual SBlockSetI * BSAPI_METHOD GetBlockSet() = 0; 06365 }; 06366 06385 class SSignalModelling2I : public SUnknownI, public SWaveformSourceCallbackI 06386 { 06387 public: 06392 virtual bool BSAPI_METHOD Init(const char *pConfigFile) = 0; 06393 06398 virtual bool BSAPI_METHOD SetModelDirectory(const char *pModelDirectory) = 0; 06402 virtual char * BSAPI_METHOD GetModelDirectory() = 0; 06406 virtual int BSAPI_METHOD GetNRequestedTrainingIters() = 0; 06411 virtual bool BSAPI_METHOD StartTrainingIteration() = 0; 06420 virtual bool BSAPI_METHOD AddWaveform(const char *pModelName, void *pWaveform, int nBytes, unsigned int flags = PF_LASTFRAME | PF_OFFLINEPROC) = 0; 06427 virtual bool BSAPI_METHOD AddFile(const char *pModelName, const char *pFile) = 0; 06432 virtual bool BSAPI_METHOD AddFilesFromListFile(const char *pListFile) = 0; 06437 virtual bool BSAPI_METHOD AddFilesFromMemList(const char *pMemList) = 0; 06444 virtual bool BSAPI_METHOD AddFilesFromDirectory(const char *pModelName, const char *pDirectory, const char *pSuffix) = 0; 06448 virtual bool BSAPI_METHOD FinishTraining() = 0; 06449 06456 virtual bool BSAPI_METHOD ActivateModels(const char *pList) = 0; 06461 virtual bool BSAPI_METHOD ActivateAllModels() = 0; 06473 virtual bool BSAPI_METHOD TestWaveform(void *pWaveform, int nBytes, unsigned int flags = PF_LASTFRAME | PF_OFFLINEPROC) = 0; 06479 virtual bool BSAPI_METHOD ResetTest() = 0; 06485 virtual bool BSAPI_METHOD TestFile(const char *pFile) = 0; 06495 virtual bool BSAPI_METHOD SetActiveWaveformPart(float startInSec, float lenInSec) = 0; 06501 virtual void BSAPI_METHOD Cancel() = 0; 06508 virtual void BSAPI_METHOD SetSaveTemporalFiles(bool saveTemporalFiles) = 0; 06517 virtual void BSAPI_METHOD SetOverwriteFiles(bool overwriteFiles) = 0; 06525 virtual void BSAPI_METHOD SetTemporalFileName(const char *pName) = 0; 06530 virtual bool BSAPI_METHOD RemoveModel(const char *pName) = 0; 06536 virtual bool BSAPI_METHOD RenameModel(const char *pOldName, const char *pNewName) = 0; 06537 06542 virtual SModelListI * BSAPI_METHOD GetModelList(int index = 0) = 0; 06543 06553 virtual bool BSAPI_METHOD SetUseWaveformFilter(bool useWaveformFilter = false) = 0; 06554 06562 virtual SWaveformFormatConvertorI * BSAPI_METHOD GetWaveformFormatConvertor() = 0; 06563 06568 virtual SBlockSetI * BSAPI_METHOD GetBlockSet() = 0; 06569 06576 virtual void BSAPI_METHOD SetTarget(SScoreCallbackI *pTarget) = 0; 06577 }; 06578 06587 class SLIDI : public SSignalModellingI 06588 { 06589 }; 06590 06597 class SGenderIDI : public SSignalModellingI 06598 { 06599 }; 06600 06609 class SSpeakerIDI : public SSignalModellingI 06610 { 06611 public: 06612 06619 virtual void BSAPI_METHOD SetMinDepTestLength(float minDepTestLength) = 0; 06620 06621 06627 virtual SSignalModellingI * BSAPI_METHOD GetIndependentSystem() = 0; 06628 }; 06629 06642 class SSpeakerID2I : public SSignalModelling2I 06643 { 06644 public: 06645 }; 06646 06659 class SLID2I : public SSignalModelling2I 06660 { 06661 public: 06662 }; 06663 06674 class SGenderID2I : public SSignalModelling2I 06675 { 06676 }; 06677 06691 class SSpeechFilePreselectorI : public SUnknownI 06692 { 06693 public: 06694 06699 virtual bool BSAPI_METHOD Init(const char *pConfigFile) = 0; 06700 06704 virtual bool BSAPI_METHOD ProcessFile(const char *pFile) = 0; 06705 06711 virtual bool BSAPI_METHOD Run() = 0; 06712 06715 virtual void BSAPI_METHOD Stop() = 0; 06716 06721 virtual bool BSAPI_METHOD SetInputDirectory(const char *pInputDirectory) = 0; 06722 06727 virtual bool BSAPI_METHOD SetPriorityInputDirectory(const char *pPriorityInputDirectory) = 0; 06728 06732 virtual void BSAPI_METHOD SetSpeechOutputDirectory(const char *pSpeechOutputDirectory) = 0; 06733 06737 virtual void BSAPI_METHOD SetSilenceOutputDirectory(const char *pSilenceOutputDirectory) = 0; 06738 06742 virtual void BSAPI_METHOD SetTechnicalOutputDirectory(const char *pTechnicalOutputDirectory) = 0; 06743 06749 virtual void BSAPI_METHOD SetUseWaveformFilter(bool useWaveformFilter = false) = 0; 06750 }; 06751 06754 class SFileListI : public SUnknownI 06755 { 06756 public: 06757 virtual void BSAPI_METHOD Clear() = 0; 06758 06759 virtual bool BSAPI_METHOD AddList(const char *pFile) = 0; 06760 virtual bool BSAPI_METHOD AddListFromMem(const char *pMem) = 0; 06761 virtual bool BSAPI_METHOD AddLineStr(const char *pLine) = 0; 06762 virtual bool BSAPI_METHOD AddLine(const char *pTarget, const char *pSource, int start, int end, float prob) = 0; 06763 06764 virtual int BSAPI_METHOD GetNLines() = 0; 06765 06766 virtual void BSAPI_METHOD ProcessList() = 0; 06767 06768 virtual void BSAPI_METHOD FirstLine() = 0; 06769 virtual bool BSAPI_METHOD GetLine(char *pTarget, char *pSource, int *pStart, int *pEnd, float *pProb) = 0; 06770 06771 virtual void BSAPI_METHOD ProcessListAsync() = 0; 06772 virtual void BSAPI_METHOD Terminate(bool waitForTermination = true) = 0; 06773 virtual bool BSAPI_METHOD IsTerminated() = 0; 06774 06775 virtual void BSAPI_METHOD SetVerbose(bool verbose = false) = 0; 06776 virtual void BSAPI_METHOD SetTarget(SFileListCallbackI *pTargetHandler) = 0; 06777 }; 06778 06781 class SFileSnifferI : public SUnknownI 06782 { 06783 public: 06784 virtual void BSAPI_METHOD SetTarget(SFileSnifferCallbackI *pTargetHandler) = 0; 06785 06786 // List of searched directories 06787 virtual bool BSAPI_METHOD AddDirectory(const char *pDirectory, int priority = 0) = 0; 06788 virtual void BSAPI_METHOD ClearDirs() = 0; 06789 06790 // List of suffixes of wanted files. If no suffix is specified, all files are returned 06791 virtual bool BSAPI_METHOD AddWantedSuffix(const char *pSuffix) = 0; 06792 virtual void BSAPI_METHOD ClearWantedSuffixes() = 0; 06793 virtual void BSAPI_METHOD FirstWantedSuffix() = 0; 06794 virtual const char * BSAPI_METHOD GetWantedSuffix() = 0; 06795 06796 // List of suffixes of accompanying files 06797 virtual bool BSAPI_METHOD AddAccompanyingSuffix(const char *pSuffix) = 0; 06798 virtual void BSAPI_METHOD ClearAccompanyingSuffixes() = 0; 06799 virtual void BSAPI_METHOD FirstAccompanyingSuffix() = 0; 06800 virtual const char * BSAPI_METHOD GetAccompanyingSuffix() = 0; 06801 06802 // Default directory for files without full path 06803 virtual void BSAPI_METHOD SetDefaultDirectory(const char *pDefaultDirectory) = 0; 06804 virtual void BSAPI_METHOD SetUpdateInterval(float updateIntervalSec = 0.05f) = 0; 06805 virtual void BSAPI_METHOD SetUseLocking(bool useLocking = false) = 0; 06806 06807 // Asynchronous mode 06808 virtual bool BSAPI_METHOD ProcessFilesAsync() = 0; 06809 virtual void BSAPI_METHOD Terminate(bool waitForTermination = true) = 0; 06810 virtual bool BSAPI_METHOD IsTerminated() = 0; 06811 06812 // Directory listing (synchronous) mode 06813 virtual bool BSAPI_METHOD ProcessFiles() = 0; 06814 virtual bool BSAPI_METHOD FirstFile() = 0; 06815 virtual bool BSAPI_METHOD GetFile(char *pFile, unsigned int len) = 0; 06816 virtual int BSAPI_METHOD GetNFiles() = 0; 06817 06818 // Lock facility 06819 virtual bool BSAPI_METHOD LockFile(const char *pFile) = 0; 06820 virtual bool BSAPI_METHOD UnlockFile(const char *pFile) = 0; 06821 virtual bool BSAPI_METHOD UnlockAllFiles() = 0; 06822 virtual bool BSAPI_METHOD IsFileLocked(const char *pFile) = 0; 06823 }; 06824 06827 class SFileLockI : public SUnknownI 06828 { 06829 public: 06830 virtual unsigned int BSAPI_METHOD ReleaseAndDelete() = 0; 06831 virtual void BSAPI_METHOD SetDeleteAtUnlock(bool deleteAtUnlock) = 0; 06832 06833 virtual bool BSAPI_METHOD Lock(const char *pFile) = 0; 06834 virtual bool BSAPI_METHOD Unlock() = 0; 06835 virtual bool BSAPI_METHOD IsLocked() = 0; 06836 06837 virtual const char * BSAPI_METHOD GetFileName() = 0; 06838 }; 06839 06842 class SAsyncFuncI : public SUnknownI 06843 { 06844 public: 06845 virtual void BSAPI_METHOD SetTarget(SAsyncFuncCallbackI *pTargetHandler) = 0; 06846 06847 // Runs the async function (defined in callback object) 06848 virtual bool BSAPI_METHOD RunAsync(void *pArgument) = 0; 06849 06850 // Terminates the async function immediately 06851 virtual void BSAPI_METHOD Terminate() = 0; 06852 06853 // Blocks until the async function returns 06854 virtual void BSAPI_METHOD WaitForTermination() = 0; 06855 06856 // Tests wether the async function has already returned or not 06857 virtual bool BSAPI_METHOD IsTerminated() = 0; 06858 }; 06859 06865 class SXMLPropertiesI : public SUnknownI 06866 { 06867 public: 06868 virtual void BSAPI_METHOD Clear() = 0; 06869 virtual const char * BSAPI_METHOD GetValue(const char *pName) = 0; 06870 virtual bool BSAPI_METHOD Set(const char *pName, const char *pArg = "") = 0; 06871 virtual void BSAPI_METHOD FirstName() = 0; 06872 virtual const char * BSAPI_METHOD GetName() = 0; 06873 virtual bool BSAPI_METHOD Exists(const char *pName) = 0; 06874 virtual bool BSAPI_METHOD Remove(const char *pName) = 0; 06875 virtual const char * BSAPI_METHOD GetAsText() = 0; 06876 virtual void BSAPI_METHOD ReleaseText() = 0; 06877 virtual int BSAPI_METHOD GetNProperties() = 0; 06878 virtual bool BSAPI_METHOD Add(SXMLPropertiesI *pProperties) = 0; 06879 virtual bool BSAPI_METHOD Assign(SXMLPropertiesI *pProperties) = 0; 06880 }; 06881 06887 class SXMLNodeI : public SUnknownI 06888 { 06889 public: 06890 virtual bool BSAPI_METHOD SetName(const char *pName) = 0; 06891 virtual const char * BSAPI_METHOD GetName() = 0; 06892 virtual bool BSAPI_METHOD SetText(const char *pText) = 0; 06893 virtual const char * BSAPI_METHOD GetText() = 0; 06894 virtual bool BSAPI_METHOD SetData(void *pdata) = 0; 06895 virtual void * BSAPI_METHOD GetData() = 0; 06896 virtual void BSAPI_METHOD SetQuoted(bool quoted) = 0; 06897 virtual bool BSAPI_METHOD GetQuoted() = 0; 06898 virtual void BSAPI_METHOD SetStartFileLine(int startFileLine) = 0; 06899 virtual int BSAPI_METHOD GetStartFileLine() = 0; 06900 virtual void BSAPI_METHOD SetStopFileLine(int stopFileLine) = 0; 06901 virtual int BSAPI_METHOD GetStopFileLine() = 0; 06902 virtual void BSAPI_METHOD SetDocument(SXMLDocumentI *pDocument) = 0; 06903 virtual SXMLDocumentI * BSAPI_METHOD GetDocument() = 0; 06904 virtual void BSAPI_METHOD SetParent(SXMLNodeI *pParent) = 0; 06905 virtual SXMLNodeI* BSAPI_METHOD GetParent() = 0; 06906 virtual SXMLPropertiesI * BSAPI_METHOD GetProperties() = 0; 06907 06908 virtual bool BSAPI_METHOD AddChild(SXMLNodeI *pNode) = 0; 06909 virtual SXMLNodeI * BSAPI_METHOD AddChildByName(const char *pName, const char *pText = "") = 0; 06910 virtual void BSAPI_METHOD RemoveChild(SXMLNodeI *pNode) = 0; 06911 virtual bool BSAPI_METHOD RemoveChildByName(const char *pName, const char *pProperties) = 0; 06912 virtual void BSAPI_METHOD RemoveAllChilds() = 0; 06913 virtual void BSAPI_METHOD FirstChild() = 0; 06914 virtual SXMLNodeI * BSAPI_METHOD GetChild() = 0; 06915 virtual SXMLNodeI * BSAPI_METHOD GetChildByName(const char *pName, const char *pProperties = "") = 0; 06916 virtual const char * BSAPI_METHOD GetAsText(int spaceLevel = 0) = 0; 06917 virtual void BSAPI_METHOD ReleaseText() = 0; 06918 virtual const char * BSAPI_METHOD GetChildsAsText(int spaceLevel = 0) = 0; 06919 virtual void BSAPI_METHOD ReleaseTextForChilds() = 0; 06920 virtual const char * BSAPI_METHOD GetPath(SXMLPropertiesI *pIncludeProperties = 0) = 0; 06921 06922 virtual bool BSAPI_METHOD HasEqualText(const char *pText) = 0; 06923 virtual bool BSAPI_METHOD IsEqual(SXMLNodeI *pNode) = 0; 06924 06925 virtual bool BSAPI_METHOD CopyNodeNoChilds(SXMLNodeI *pNode) = 0; 06926 virtual bool BSAPI_METHOD CopyChilds(SXMLNodeI *pNode) = 0; 06927 virtual bool BSAPI_METHOD Assign(SXMLNodeI *pNode) = 0; 06928 }; 06929 06938 class SXMLDocumentI : public SUnknownI 06939 { 06940 public: 06941 06942 // new document 06943 virtual bool BSAPI_METHOD New() = 0; 06944 06945 // load XML document 06946 virtual bool BSAPI_METHOD Load(const char *pFile) = 0; 06947 06948 // save XML document 06949 virtual bool BSAPI_METHOD Save(const char *pFile, unsigned int flags = XMLF_ADDHEADER) = 0; 06950 virtual void BSAPI_METHOD SetEncoding(const char *pEncoding) = 0; 06951 virtual void BSAPI_METHOD SetStyleSheet(const char *pStyleSheet) = 0; 06952 06953 // parsing functions 06954 virtual bool BSAPI_METHOD ParseText(const char *pText, bool newDocument = true) = 0; 06955 virtual bool BSAPI_METHOD ParseProperties(const char *pText, SXMLPropertiesI *pProperties, const char *pNodeName, const char *pFile, int *pFileLine, char **ppNextText) = 0; 06956 06957 // create XML text 06958 virtual const char * BSAPI_METHOD GetAsText(unsigned int flags = XMLF_ADDHEADER) = 0; 06959 virtual void BSAPI_METHOD ReleaseText() = 0; 06960 06961 // node manipulation functions 06962 virtual SXMLNodeI * BSAPI_METHOD GetRootNode() = 0; 06963 virtual SXMLNodeI * BSAPI_METHOD GetNode(const char *pKey, bool insertNodes = true) = 0; 06964 virtual void BSAPI_METHOD RemoveNode(SXMLNodeI *pNode) = 0; 06965 virtual void BSAPI_METHOD RemoveNodeByName(const char *pKey) = 0; 06966 virtual bool BSAPI_METHOD Exists(const char *pKey) = 0; 06967 06968 // access operator 06969 virtual const char * BSAPI_METHOD GetValue(const char *pKey) = 0; 06970 virtual bool BSAPI_METHOD Set(const char *pKey, const char *pValue) = 0; 06971 06972 virtual bool BSAPI_METHOD Assign(SXMLDocumentI *pXMLDoc) = 0; 06973 }; 06974 06977 class SKeywordI : public SUnknownI 06978 { 06979 public: 06980 06981 virtual bool BSAPI_METHOD SetFromXML(const char *pXMLText, const char *pSourceInfo = 0) = 0; 06982 virtual const char * BSAPI_METHOD GetAsXML() = 0; 06983 virtual void BSAPI_METHOD ReleaseXMLText() = 0; 06984 06985 virtual bool BSAPI_METHOD SetName(const char *pKeyword) = 0; 06986 virtual void BSAPI_METHOD SetEnabled(bool enabled) = 0; 06987 virtual void BSAPI_METHOD SetAcceptThreshold(float acceptThreshold) = 0; 06988 virtual void BSAPI_METHOD SetDenyThreshold(float denyThreshold) = 0; 06989 06990 virtual const char * BSAPI_METHOD GetName() = 0; 06991 virtual bool BSAPI_METHOD GetEnabled() = 0; 06992 virtual float BSAPI_METHOD GetAcceptThreshold() = 0; 06993 virtual float BSAPI_METHOD GetDenyThreshold() = 0; 06994 06995 // true if at least one pronunciation variant is enabled and valid 06996 virtual bool BSAPI_METHOD GetIsValid() = 0; 06997 virtual void BSAPI_METHOD SetIsNameValid(bool isNameValid) = 0; 06998 virtual bool BSAPI_METHOD GetIsNameValid() = 0; 06999 07000 virtual SXMLDocumentI * BSAPI_METHOD GetXMLDocument() = 0; 07001 virtual SPronunciationListI * BSAPI_METHOD GetPronunciationList() = 0; 07002 07003 virtual void BSAPI_METHOD SetModifiedFlagPointer(bool *pModifiedFlag) = 0; 07004 }; 07005 07008 class SKeywordListI : public SUnknownI 07009 { 07010 public: 07011 typedef enum 07012 { 07013 apmAdd, // add pronunciations from lexicon or G2P 07014 apmCondAdd, // add pronunciations from lexicon or G2P only if do not exist 07015 apmReplace // replace pronunciations with pronunciations from lexicon or G2P 07016 } ap_mode_type; 07017 07018 typedef enum 07019 { 07020 ffXML, // XML format - full keyword description allowed 07021 ffPlain // plain text format - just a keyword name per line 07022 } file_format_type; 07023 07024 virtual void BSAPI_METHOD Clear() = 0; 07025 07026 virtual SKeywordI * BSAPI_METHOD Add(const char *pKeyword) = 0; 07027 virtual SKeywordI * BSAPI_METHOD GetByName(const char *pKeyword) = 0; 07028 virtual bool BSAPI_METHOD Exists(const char *pKeyword) = 0; 07029 virtual bool BSAPI_METHOD Remove(const char *pKeyword) = 0; 07030 07031 virtual bool BSAPI_METHOD SetFromXML(const char *pXMLText, const char *pSourceInfo = 0) = 0; 07032 virtual const char * BSAPI_METHOD GetAsXML() = 0; 07033 virtual void BSAPI_METHOD ReleaseXMLText() = 0; 07034 07035 virtual void BSAPI_METHOD First() = 0; 07036 virtual SKeywordI * BSAPI_METHOD GetKeyword() = 0; 07037 virtual bool BSAPI_METHOD Load(const char *pFile, file_format_type format = ffXML) = 0; 07038 virtual bool BSAPI_METHOD Save(const char *pFile, const char *pStyleSheet = 0, file_format_type format = ffXML) = 0; 07039 07040 virtual int BSAPI_METHOD GetNKeywords() = 0; 07041 virtual int BSAPI_METHOD GetNEnabledKeywords() = 0; 07042 virtual int BSAPI_METHOD GetNValidKeywords() = 0; 07043 07044 virtual float BSAPI_METHOD GetGlobalAcceptThreshold() = 0; 07045 virtual float BSAPI_METHOD GetGlobalDenyThreshold() = 0; 07046 virtual void BSAPI_METHOD SetGlobalAcceptThreshold(float globalAcceptThreshold = 0.0f) = 0; 07047 virtual void BSAPI_METHOD SetGlobalDenyThreshold(float denyAcceptThreshold = 0.0f) = 0; 07048 07049 virtual void BSAPI_METHOD SetPhnTrans(SPhnTransI *pPhnTrans) = 0; 07050 virtual bool BSAPI_METHOD AddPronunciations(ap_mode_type mode) = 0; 07051 virtual bool BSAPI_METHOD CheckKeywords(bool *pRetAreInvalidKeywords = 0) = 0; 07052 07053 virtual bool BSAPI_METHOD GetModifiedFlag() = 0; 07054 virtual void BSAPI_METHOD ResetModifiedFlag() = 0; 07055 07056 virtual void BSAPI_METHOD SetCheckPronunciations(bool checkPronunciations = true) = 0; 07057 virtual void BSAPI_METHOD SetCheckWordNames(bool checkWordNames = true) = 0; 07058 virtual void BSAPI_METHOD SetReportErrorsImmediately(bool reportErrorsImmediately = true) = 0; 07059 07060 virtual bool BSAPI_METHOD LoadExternalCharsetTable(const char *pFile = "none") = 0; 07061 07062 07063 }; 07064 07067 class SPronunciationI : public SUnknownI 07068 { 07069 public: 07070 virtual void BSAPI_METHOD SetId(unsigned int id) = 0; 07071 virtual unsigned int BSAPI_METHOD GetId() = 0; 07072 07073 virtual const char * BSAPI_METHOD GetPhonemes() = 0; 07074 virtual bool BSAPI_METHOD SetPhonemes(const char *pPhonemes) = 0; 07075 07076 virtual int BSAPI_METHOD GetLength() = 0; 07077 07078 virtual void BSAPI_METHOD SetEnabled(bool enabled) = 0; 07079 virtual bool BSAPI_METHOD GetEnabled() = 0; 07080 07081 virtual const char * BSAPI_METHOD GetSource() = 0; 07082 virtual bool BSAPI_METHOD SetSource(const char *pSource) = 0; 07083 07084 virtual float BSAPI_METHOD GetLogProbability() = 0; 07085 virtual void BSAPI_METHOD SetLogProbability(float logProbability) = 0; 07086 07087 virtual void BSAPI_METHOD SetIsValid(bool isValid) = 0; 07088 virtual bool BSAPI_METHOD GetIsValid() = 0; 07089 07090 virtual void BSAPI_METHOD SetModifiedFlagPointer(bool *pModifiedFlag) = 0; 07091 }; 07092 07095 class SPronunciationListI : public SUnknownI 07096 { 07097 public: 07098 virtual void BSAPI_METHOD Clear() = 0; 07099 07100 virtual SPronunciationI * BSAPI_METHOD Add() = 0; 07101 virtual bool BSAPI_METHOD RemoveById(unsigned int id) = 0; 07102 virtual bool BSAPI_METHOD RemoveByPron(const char *pPhonemes) = 0; 07103 07104 virtual bool BSAPI_METHOD SetFromXML(const char *pXMLText, const char *pSourceInfo = 0) = 0; 07105 virtual const char * BSAPI_METHOD GetAsXML() = 0; 07106 virtual void BSAPI_METHOD ReleaseXMLText() = 0; 07107 07108 virtual int BSAPI_METHOD GetNPronunciations() = 0; 07109 07110 virtual void BSAPI_METHOD First() = 0; 07111 virtual SPronunciationI * BSAPI_METHOD GetPronunciation() = 0; 07112 07113 virtual SPronunciationI * BSAPI_METHOD GetPronunciationById(unsigned int id, const char *pWordInfo) = 0; 07114 07115 virtual void BSAPI_METHOD SetModifiedFlagPointer(bool *pModifiedFlag) = 0; 07116 }; 07117 07124 class SKeywordSpottingI : public SUnknownI 07125 { 07126 public: 07127 typedef enum 07128 { 07129 kiWaveform, 07130 kiPosteriors 07131 } kws_input_type; 07132 07133 virtual bool BSAPI_METHOD ProcessFile(const char *pInputFile, const char *pOutputHypothesesFile, const char *pOutputDetectionsFile, kws_input_type inputKind = kiWaveform) = 0; 07134 virtual bool BSAPI_METHOD ProcessWaveform(SWaveformSourceCallbackI::wave_format_type waveformFormat, int sampleFreq, int nChannels, void *pData, int nBytes) = 0; 07135 07136 virtual bool BSAPI_METHOD ExtractFeatures(const char *pInputFile, const char *pOutputFeatureFile) = 0; 07137 07138 virtual SKeywordListI * BSAPI_METHOD GetKeywordList() = 0; 07139 virtual SPhnTransI * BSAPI_METHOD GetPhnTrans() = 0; 07140 virtual SBlockSetI * BSAPI_METHOD GetBlockSet() = 0; 07141 07142 virtual void BSAPI_METHOD SetHypothesesTarget(STransCallbackI *pTarget) = 0; 07143 virtual void BSAPI_METHOD SetDetectionsTarget(STransCallbackI *pTarget) = 0; 07144 07145 virtual bool BSAPI_METHOD Init(const char *pConfigFile) = 0; 07146 }; 07147 07150 class SKeywordDetectionFilterI : public SUnknownI, public STransCallbackI 07151 { 07152 public: 07153 typedef enum 07154 { 07155 apmOverlappedKW, // filter the same overlapped keywords (not variants) 07156 apmOverlappedGlob // filter all overlapped keywords 07157 } ap_filter_mode_type; 07158 virtual void BSAPI_METHOD SetTarget(STransCallbackI *pTarget) = 0; 07159 virtual bool BSAPI_METHOD SetFilterMode(const char *pModeStr = "OverlappedKW") = 0; //OverlappedKW, OverlappedGlob 07160 07161 }; 07162 07165 class SKeywordThresholdI : public SUnknownI, public STransCallbackI 07166 { 07167 public: 07168 virtual void BSAPI_METHOD SetTarget(STransCallbackI *pTarget) = 0; 07169 virtual void BSAPI_METHOD SetKeywordList(SKeywordListI *pKeywordList) = 0; 07170 virtual bool BSAPI_METHOD GetIsAllBelowAcceptThreshold() = 0; 07171 virtual bool BSAPI_METHOD GetIsAllBelowDenyThreshold() = 0; 07172 virtual void BSAPI_METHOD SetResetOnIsLast(bool resetOnIsLast = true) = 0; 07173 virtual void BSAPI_METHOD Reset() = 0; 07174 }; 07175 07178 class SKeywordScoreNormI : public SUnknownI, public STransCallbackI 07179 { 07180 public: 07181 virtual void BSAPI_METHOD SetTarget(STransCallbackI *pTarget) = 0; 07182 07183 virtual void BSAPI_METHOD SetComputeLogit(bool b) = 0; 07184 virtual void BSAPI_METHOD SetComputeSigmoid(bool b) = 0; 07185 virtual void BSAPI_METHOD SetAdditiveConstant(double v) = 0; 07186 virtual void BSAPI_METHOD SetMultiplicativeConstant(double v) = 0; 07187 virtual bool BSAPI_METHOD LoadPhonemeMappingRules(const char *pFilename) = 0; // bs:include bs:only_if_set 07188 virtual bool BSAPI_METHOD LoadNormParameters(const char *pFilename) = 0; // bs:include bs:only_if_set 07189 virtual void BSAPI_METHOD SetClearCachePerFile(bool clearcache = false) = 0; 07190 virtual void BSAPI_METHOD SetKeywordList(SKeywordListI * pKeywordList) = 0; 07191 }; 07192 07195 class SKeywordDurationModelI : public SUnknownI, public STransCallbackI 07196 { 07197 public: 07198 virtual void BSAPI_METHOD SetTarget(STransCallbackI *pTarget) = 0; 07199 07200 virtual void BSAPI_METHOD SetLengthNormConstant(double d = 0.0) = 0; 07201 virtual bool BSAPI_METHOD LoadPhonemeMappingRules(const char *pFilename) = 0; // bs:include bs:only_if_set 07202 virtual bool BSAPI_METHOD LoadPhonemeLengthStats(const char *pFilename) = 0; // bs:include bs:only_if_set 07203 virtual void BSAPI_METHOD SetKeywordList(SKeywordListI * pKeywordList) = 0; 07204 }; 07205 07208 class SPhoneticLabelExpansionI : public SUnknownI, public STransCallbackI 07209 { 07210 public: 07211 virtual void BSAPI_METHOD SetTarget(STransCallbackI *pTarget) = 0; 07212 07213 virtual void BSAPI_METHOD SetLength(int length) = 0; 07214 virtual void BSAPI_METHOD SetErrorHandler(SErrorCallbackI *pErrorHandler) = 0; 07215 virtual bool BSAPI_METHOD LoadCiPhonemesList(const char *pFilename) = 0; // bs:include bs:only_if_set 07216 virtual bool BSAPI_METHOD LoadCiNoInfluencePhonemesList(const char *pFilename) = 0; // bs:include bs:only_if_set 07217 }; 07218 07221 class SCharSetI : public SUnknownI 07222 { 07223 public: 07224 virtual bool BSAPI_METHOD Utf8ToWideChar(const char *pUtf8, bsapi_wchar_t *pRetWideString, int maxLen, int *pRetLen) = 0; 07225 virtual bool BSAPI_METHOD WideCharToUtf8(const bsapi_wchar_t *pWideString, char *pUtf8, int maxLen, int *pRetLen) = 0; 07226 07227 // true if the first UTF8 character is BOM (0xEF, 0xBB, 0xBF). The UTF8 documents can use this as an header for easy detection. 07228 // Use notepad to write documents with this initial character. 07229 virtual bool BSAPI_METHOD HasByteOrderMark(const char *pText) = 0; 07230 07231 virtual bool BSAPI_METHOD LoadCharSetTable(const char *pFile) = 0; 07232 virtual bool BSAPI_METHOD StrToWideStr(const char *pInput, bsapi_wchar_t *pOutput) = 0; 07233 virtual bool BSAPI_METHOD StrToUtf8(const char *pStr, char *pUtf, int maxLen, int *pRetLen) = 0; 07234 virtual bool BSAPI_METHOD WideStrToStr(const bsapi_wchar_t *pInput, char *pOutput) = 0; 07235 virtual bool BSAPI_METHOD Utf8ToStr(const char *pUtf8, char *pStr, int maxLen, int *pRetLen) = 0; 07236 }; 07237 07241 class SFeatureDumperI : public SUnknownI, public SFeatureExtractionCallbackI 07242 { 07243 public: 07244 virtual void BSAPI_METHOD SetTarget(SFeatureExtractionCallbackI *pTarget) = 0; 07245 virtual bool BSAPI_METHOD SetOutputFilenameMask(const char *pFilenameMask = "features_%d_%d_%d") = 0; 07246 // contains %d %d %d - feature matrix counter, number of frames in feature matrix, received flags 07247 virtual bool BSAPI_METHOD SetOutputFormatStr(const char *pFormat = "htk") = 0; 07248 virtual void BSAPI_METHOD SetOutputFormat(SFloatMatrixI::file_format_type format = SFloatMatrixI::ffAscii) = 0; 07249 }; 07250 07254 class STranscriptionDumperI : public SUnknownI, public STransCallbackI 07255 { 07256 public: 07257 virtual void BSAPI_METHOD SetTarget(STransCallbackI *pTarget) = 0; 07258 virtual bool BSAPI_METHOD SetOutputFilenameMask(const char *pFilenameMask = "transcription_%d") = 0; 07259 }; 07260 07264 class SScoreDumperI : public SUnknownI, public SScoreCallbackI 07265 { 07266 public: 07267 virtual void BSAPI_METHOD SetTarget(SScoreCallbackI *pTarget) = 0; 07268 virtual void BSAPI_METHOD SetFileName(const char *pFilename) = 0; 07269 virtual bool BSAPI_METHOD SetFormatStr(const char *pFormat) = 0; 07270 virtual bool BSAPI_METHOD SetColumnFormatStr(const char *pFormat) = 0; 07271 virtual void BSAPI_METHOD SetSuppressTooShort(bool tooShort) = 0; 07272 }; 07273 07276 class SFSTTargetI : public SUnknownI, public STransCallbackI 07277 { 07278 public: 07279 virtual void BSAPI_METHOD SetFileName(const char *pFilename) = 0; // bs:exclude 07280 virtual bool BSAPI_METHOD LoadInternalCharsetTable(const char *pFile = "none") = 0; // bs:include bs:only_if_set 07281 virtual void BSAPI_METHOD SetSegmentationSymbol(const char *pSymbol = "_SILENSE_") = 0; 07282 07283 virtual void BSAPI_METHOD SetSpeechLabel(const char *pSpeechLabel = "voice") = 0; 07284 virtual void BSAPI_METHOD SetNonSpeechLabel(const char *pNonSpeechLabel = "silense") = 0; 07285 virtual void BSAPI_METHOD SetRemovedSymbols(const char *pSymbols = "") = 0; // bs:exclude 07286 07287 virtual void BSAPI_METHOD SetSave(bool save = true) = 0; 07288 virtual void BSAPI_METHOD SetAddNodeIds (bool nodeIds = false) = 0; 07289 virtual void BSAPI_METHOD SetAddTimeSlot (bool timeSlot = false) = 0; 07290 virtual void BSAPI_METHOD SetAddWord (bool word = true) = 0; 07291 virtual void BSAPI_METHOD SetAddPosteriorProbability (bool posteriorProb = false) = 0; 07292 virtual void BSAPI_METHOD SetPosteriorProbabilityInLog(bool posteriorProbabilityInLog = false) = 0; 07293 virtual void BSAPI_METHOD SetAddStartTime (bool startTime = true) = 0; //in seconds 07294 virtual void BSAPI_METHOD SetAddEndTime (bool endTime = true) = 0; //in seconds 07295 virtual void BSAPI_METHOD SetAddLanguageProbability (bool languageProb = false) = 0; 07296 virtual void BSAPI_METHOD SetAddAcusticProbability (bool acusticProb = false) = 0; 07297 virtual void BSAPI_METHOD SetAddWordLikelihood (bool wordLikelihood = false) = 0; 07298 virtual void BSAPI_METHOD SetFormatStr (const char *pFormat = "WSE") = 0; 07299 07300 virtual void BSAPI_METHOD SetSegmentationSource(SUnknownI *pSegSource) = 0; // bs:source 07301 virtual void BSAPI_METHOD SetTranscriptionSource(SUnknownI *pTranSource) = 0; // bs:source 07302 }; 07303 07306 class STranscriptionTargetI : public SUnknownI, public STransCallbackI 07307 { 07308 public: 07309 typedef enum 07310 { 07311 tftTxt, 07312 tftLbf, 07313 tftFst, 07314 } transt_format_type; 07315 07316 virtual void BSAPI_METHOD SetFileName(const char *pFilename) = 0; // bs:exclude 07317 virtual void BSAPI_METHOD SetSegmentationSymbol(const char *pSymbol = "-") = 0; 07318 virtual void BSAPI_METHOD SetWrapAfterSymbol(const char *pSymbol = "</s>") = 0; 07319 07320 virtual void BSAPI_METHOD SetSpeechLabel(const char *pSpeechLabel = "voice") = 0; 07321 virtual void BSAPI_METHOD SetNonSpeechLabel(const char *pNonSpeechLabel = "silense") = 0; 07322 virtual void BSAPI_METHOD SetRemovedSymbols(const char *pSymbols = "") = 0; // bs:exclude 07323 07324 virtual void BSAPI_METHOD SetSave(bool save = true) = 0; 07325 virtual void BSAPI_METHOD SetAddNodeIds (bool nodeIds = false) = 0; 07326 virtual void BSAPI_METHOD SetAddWord (bool word = true) = 0; 07327 virtual void BSAPI_METHOD SetAddPosteriorProbability (bool posteriorProb = false) = 0; 07328 virtual void BSAPI_METHOD SetAddStartTime (bool startTime = true) = 0; //in seconds 07329 virtual void BSAPI_METHOD SetAddEndTime (bool endTime = true) = 0; //in seconds 07330 virtual void BSAPI_METHOD SetAddWordLikelihood (bool wordLikelihood = false) = 0; 07331 virtual void BSAPI_METHOD SetFormatStr (const char *pFormat = "TXT") = 0; 07332 07333 virtual void BSAPI_METHOD SetSegmentationSource(SUnknownI *pSegSource) = 0; // bs:source 07334 virtual void BSAPI_METHOD SetTranscriptionSource(SUnknownI *pTranSource) = 0; // bs:source 07335 }; 07336 07342 class STranscriptionNodeI : public SUnknownI, public STransCallbackI 07343 { 07344 public: 07345 virtual void BSAPI_METHOD SetTarget(STransCallbackI *pTarget) = 0; 07346 virtual void BSAPI_METHOD SetEnabled(bool enabled = true) = 0; 07347 }; 07348 07356 class SFeatureSplitterI : public SUnknownI, public SFeatureExtractionCallbackI 07357 { 07358 public: 07359 07368 virtual bool BSAPI_METHOD SetTarget(int index, SFeatureExtractionCallbackI *pTarget) = 0; 07369 07376 virtual bool BSAPI_METHOD AddTarget(SFeatureExtractionCallbackI *pTarget) = 0; 07377 }; 07378 07381 class SFeaPasteI : public SUnknownI, public SFeatureExtractionCallbackI 07382 { 07383 public: 07384 virtual void BSAPI_METHOD SetTarget(SFeatureExtractionCallbackI *pTarget) = 0; 07385 virtual void BSAPI_METHOD Reset() = 0; 07386 07387 virtual void BSAPI_METHOD SetSource1(SUnknownI *pSegSource) = 0; // bs:source 07388 virtual void BSAPI_METHOD SetSource2(SUnknownI *pTranSource) = 0; // bs:source 07389 }; 07390 07393 class SRandomGeneratorI : public SUnknownI 07394 { 07395 public: 07396 virtual void BSAPI_METHOD InitFromUInteger(unsigned int value) = 0; 07397 virtual unsigned int BSAPI_METHOD GetUIntegerValue() = 0; 07398 virtual int BSAPI_METHOD GetIntegerValue() = 0; 07399 virtual float BSAPI_METHOD GetFloatValue() = 0; 07400 virtual unsigned int BSAPI_METHOD GetMaxUIntegerValue() = 0; 07401 virtual int BSAPI_METHOD GetMaxIntegerValue() = 0; 07402 }; 07403 07409 class SDataEncoderI : public SUnknownI 07410 { 07411 public: 07412 virtual bool BSAPI_METHOD Encode(char *pData, int len) = 0; 07413 virtual void BSAPI_METHOD SetKey(unsigned int key) = 0; 07414 virtual void BSAPI_METHOD SetMask(char mask) = 0; 07415 }; 07416 07427 class SLicenseManagerI : public SUnknownI 07428 { 07429 public: 07435 virtual void BSAPI_METHOD RegisterLicenseFile(const char *pFile) = 0; 07436 07443 virtual unsigned int BSAPI_METHOD GetLicense(unsigned int appId) = 0; 07444 07456 virtual bool BSAPI_METHOD CheckLicense(unsigned int licenseId, bool forceReCheck = false) = 0; 07457 07462 virtual long_long BSAPI_METHOD GetSecsToExpire(unsigned int interfaceId) = 0; 07463 07468 virtual int BSAPI_METHOD GetNLicenses(unsigned int interfaceId) = 0; 07469 07474 virtual int BSAPI_METHOD GetNUsedLicenses(unsigned int interfaceId) = 0; 07475 07482 virtual bool BSAPI_METHOD ReleaseLicense(unsigned int licenseId) = 0; 07483 }; 07484 07487 class SCmllrEstimatorI : public SUnknownI, public SStatisticsCallbackI 07488 { 07489 public: 07490 virtual SFloatMatrixI * BSAPI_METHOD Estimate(SFloatMatrixI * pMeanStats, SFloatMatrixI * pCovStats, float occup) = 0; 07491 virtual void BSAPI_METHOD SetTarget(SParametersCallbackI *pTarget) = 0; 07492 virtual void BSAPI_METHOD SetDimension(int dim) = 0; 07493 }; 07494 07497 class SVoicePrintI : public SParametersI 07498 { 07499 public: 07500 virtual bool BSAPI_METHOD Load(const char *pFile) = 0; 07501 virtual bool BSAPI_METHOD Save(const char *pFile) = 0; 07502 virtual bool BSAPI_METHOD Assign(SVoicePrintI *pVoicePrint) = 0; 07503 virtual void * BSAPI_METHOD GetData() = 0; 07504 virtual int BSAPI_METHOD GetDataLength() = 0; 07505 virtual bool BSAPI_METHOD SetData(int length, void *pData) = 0; 07506 virtual void * BSAPI_METHOD GetContentData() = 0; 07507 virtual int BSAPI_METHOD GetContentDataLength() = 0; 07508 virtual bool BSAPI_METHOD SetContentData(int length, void *pData) = 0; 07509 virtual void * BSAPI_METHOD GetUserData() = 0; 07510 virtual int BSAPI_METHOD GetUserDataLength() = 0; 07511 virtual bool BSAPI_METHOD SetUserData(int length, void *pData) = 0; 07512 virtual unsigned int BSAPI_METHOD GetVersion() = 0; 07513 virtual void BSAPI_METHOD SetVersion(unsigned int version = 1) = 0; 07514 virtual unsigned int BSAPI_METHOD GetNFrames() = 0; 07515 virtual void BSAPI_METHOD SetNFrames(unsigned int nFrames) = 0; 07516 virtual const char * BSAPI_METHOD GetSegmentId() = 0; 07517 virtual bool BSAPI_METHOD SetSegmentId(const char *pSegmentId = "") = 0; 07518 }; 07519 07524 class SVoicePrintSetI : public SUnknownI 07525 { 07526 public: 07527 virtual bool BSAPI_METHOD LoadFromList(const char *pListFile) = 0; 07528 virtual bool BSAPI_METHOD LoadFromDirectory(const char *pDirectory, const char *pSuffix) = 0; 07529 07537 virtual bool BSAPI_METHOD Add(SVoicePrintI *pVoicePrint) = 0; 07538 virtual bool BSAPI_METHOD AddFromFile(const char *pFile) = 0; 07539 virtual SVoicePrintI * BSAPI_METHOD GetByIndex(int index) = 0; 07540 virtual int BSAPI_METHOD GetNVoicePrints() = 0; 07541 07542 virtual void BSAPI_METHOD First() = 0; 07543 virtual SVoicePrintI * BSAPI_METHOD Get() = 0; 07544 07545 virtual bool BSAPI_METHOD Convert2Matrix(SFloatMatrixI *pMatrix) = 0; 07546 07547 virtual void BSAPI_METHOD Clear() = 0; 07548 }; 07549 07558 class SVoicePrintExtractorI : public SUnknownI 07559 { 07560 public: 07561 virtual bool BSAPI_METHOD Init(const char *pConfigFile) = 0; 07562 07563 virtual void BSAPI_METHOD SetOutputDirectory(const char *pOutputDirectory) = 0; 07564 virtual void BSAPI_METHOD SetWaveformFileSuffix(const char *pWaveformFileSuffix) = 0; 07565 virtual void BSAPI_METHOD SetVoicePrintFileSuffix(const char *pVoicePrintFileSuffix) = 0; 07566 virtual bool BSAPI_METHOD ProcessFile(const char *pInputFile, const char *pOutputFile) = 0; 07567 virtual bool BSAPI_METHOD ProcessList(const char *pListFile) = 0; 07568 virtual bool BSAPI_METHOD ProcessDirectory(const char *pInputDirectory) = 0; 07569 virtual bool BSAPI_METHOD ProcessWaveform(SWaveformSourceCallbackI::wave_format_type format, int sampleFreq, void *pData, int nBytes, unsigned int flags = PF_LASTFRAME | PF_OFFLINEPROC, const char *pSegmentId = 0) = 0; 07570 07571 virtual void BSAPI_METHOD SetTarget(SParametersCallbackI *pTarget) = 0; 07572 07579 virtual bool BSAPI_METHOD SetOutputIntervalSec(float outputIntervalSec = 0.0f) = 0; 07580 07581 virtual SBlockSetI * BSAPI_METHOD GetBlockSet() = 0; 07582 }; 07583 07592 class SVoicePrintComparatorI : public SUnknownI 07593 { 07594 public: 07595 virtual bool BSAPI_METHOD Init(const char *pConfigFile) = 0; 07596 07597 virtual bool BSAPI_METHOD Compare2VoicePrints(SVoicePrintI *pVoicePrint1, SVoicePrintI *pVoicePrint2, float *pRetScore) = 0; 07598 virtual bool BSAPI_METHOD Compare2VoicePrintFiles(const char *pFile1, const char *pFile2, float *pRetScore) = 0; 07599 virtual bool BSAPI_METHOD CompareVoicePrintToSet(SVoicePrintI *pVoicePrint, SVoicePrintSetI *pSet, SFloatMatrixI *pRetScores) = 0; 07600 virtual bool BSAPI_METHOD Compare2VoicePrintSets(SVoicePrintSetI *pSet1, SVoicePrintSetI *pSet2, SFloatMatrixI *pRetScores) = 0; 07601 virtual bool BSAPI_METHOD Compare2VoicePrintLists(const char *pListFile1, const char *pListFile2, SFloatMatrixI *pRetScores) = 0; 07602 virtual bool BSAPI_METHOD Compare2VoicePrintDirectories(const char *pDirectory1, const char *pDirectory2, const char *pSuffix, SFloatMatrixI *pRetScores) = 0; 07603 07604 virtual SBlockSetI * BSAPI_METHOD GetBlockSet() = 0; 07605 virtual void BSAPI_METHOD SetTwoSetComparator(STwoSetComparisonI *pTwoSetComparator) = 0; 07606 }; 07607 07612 class SUserCalibrationI : public SUnknownI, public SParametersCallbackI 07613 { 07614 public: 07615 virtual bool BSAPI_METHOD LoadFilesFromDirectory(const char *pDirectory, const char *pSuffix) = 0; 07616 virtual bool BSAPI_METHOD LoadFilesFromList(const char *pListFile) = 0; 07617 07618 virtual bool BSAPI_METHOD Load(const char *pFile) = 0; // bs:include bs:only_if_set 07619 virtual bool BSAPI_METHOD Save(const char *pFile) = 0; 07620 virtual void BSAPI_METHOD Reset() = 0; 07621 07622 virtual bool BSAPI_METHOD SetFileFormatStr(const char *pFileFormatStr = "htk") = 0; 07623 virtual void BSAPI_METHOD SetFileFormat(SFloatMatrixI::file_format_type fileFormat) = 0; 07624 07625 virtual void BSAPI_METHOD SetEnabled(bool enabled = false) = 0; 07626 07627 virtual void BSAPI_METHOD StartEstimation() = 0; 07628 virtual void BSAPI_METHOD EndEstimation() = 0; 07629 07630 virtual void BSAPI_METHOD SetUseInputData(bool useInputData = false) = 0; 07631 virtual void BSAPI_METHOD SetTarget(SParametersCallbackI *pTarget) = 0; 07632 }; 07633 07638 class SVoicePrintUserCalibrationI : public SUserCalibrationI 07639 { 07640 public: 07641 virtual void BSAPI_METHOD SetMapTau(float mapTau = 100.0f) = 0; 07642 virtual void BSAPI_METHOD SetMinSpeechLengthForEstimSec(float minSpeechLengthForEstimSec = 10.0f) = 0; 07643 }; 07644 07649 class SDiarizerI : public SUnknownI 07650 { 07651 public: 07652 virtual bool BSAPI_METHOD Init(const char *pConfigFile) = 0; 07653 07654 virtual void BSAPI_METHOD SetOutputDirectory(const char *pOutputDirectory) = 0; 07655 virtual void BSAPI_METHOD SetWaveformFileSuffix(const char *pWaveformFileSuffix) = 0; 07656 virtual void BSAPI_METHOD SetAudioFileSuffix(const char *pAudioFileSuffix) = 0; 07657 virtual void BSAPI_METHOD SetSegmentationFileSuffix(const char *pSegmentationFileSuffix) = 0; 07658 07659 virtual void BSAPI_METHOD SetSaveAudioFile(bool saveAudioFile = false) = 0; 07660 virtual void BSAPI_METHOD SetSaveSegmentationFile(bool saveSegmentationFile = false) = 0; 07661 07662 virtual bool BSAPI_METHOD ProcessFile(const char *pInputFile, const char *pOutputAudioFile, const char *pOutputSegmentationFile) = 0; 07663 virtual bool BSAPI_METHOD ProcessList(const char *pListFile) = 0; 07664 virtual bool BSAPI_METHOD ProcessDirectory(const char *pInputDirectory) = 0; 07665 virtual bool BSAPI_METHOD ProcessWaveform(SWaveformSourceCallbackI::wave_format_type waveformFormat, int sampleFreq, int nChannels, void *pData, int nBytes, unsigned int flags) = 0; 07666 07667 virtual void BSAPI_METHOD SetTarget(SWaveformSourceCallbackI *pTarget) = 0; 07668 virtual SBlockSetI * BSAPI_METHOD GetBlockSet() = 0; 07669 }; 07670 07675 class SFeatureChunkerI : public SUnknownI, public SFeatureExtractionCallbackI 07676 { 07677 public: 07678 virtual void BSAPI_METHOD SetTarget(SFeatureExtractionCallbackI *pTarget) = 0; 07679 virtual void BSAPI_METHOD SetAddLastFrameFlag(bool addLastFrameFlag = false) = 0; 07680 virtual void BSAPI_METHOD SetChunkSize(int chunkSize = 0) = 0; 07681 }; 07682 07685 class SFeatureSelectorI : public SUnknownI, public SFeatureExtractionCallbackI, public STransCallbackI 07686 { 07687 public: 07688 virtual void BSAPI_METHOD SetFrameShiftMs(int frameShiftMs = 10) = 0; 07689 virtual void BSAPI_METHOD SetTarget(SFeatureExtractionCallbackI *pTarget) = 0; 07690 }; 07691 07694 class SWaveformSelectorI : public SUnknownI, public SWaveformSourceCallbackI, public STransCallbackI 07695 { 07696 public: 07697 virtual const char * BSAPI_METHOD GetActualSegmentId() = 0; 07698 virtual void BSAPI_METHOD SetTarget(SWaveformSourceCallbackI *pTarget) = 0; 07699 }; 07700 07703 class SWaveformJoinerI : public SUnknownI, public SWaveformSourceCallbackI 07704 { 07705 public: 07706 virtual void BSAPI_METHOD SetTarget(SWaveformSourceCallbackI *pTarget) = 0; 07707 virtual SWaveformSourceCallbackI * BSAPI_METHOD GetTarget() = 0; 07708 virtual bool BSAPI_METHOD Done() = 0; 07709 virtual void BSAPI_METHOD Reset() = 0; 07710 }; 07711 07714 class SObjectMemoryI : public SUnknownI 07715 { 07716 public: 07725 virtual SUnknownI* BSAPI_METHOD AddItem(const char* pItemName, SUnknownI* pObject) = 0; 07726 07736 virtual SUnknownI* BSAPI_METHOD GetItem(const char* pItemName) = 0; 07737 07754 virtual bool BSAPI_METHOD ReleaseItem(const char* pItemName) = 0; 07755 07762 virtual bool BSAPI_METHOD ReleaseItemByRef(SUnknownI* pObject) = 0; 07763 07768 virtual bool BSAPI_METHOD ExistsItem(const char* pItemName) = 0; 07769 07781 virtual bool BSAPI_METHOD LockItem(const char* pItemName) = 0; 07782 07791 virtual bool BSAPI_METHOD UnlockItem(const char* pItemName) = 0; 07792 07793 }; 07794 07798 class SMulticoreI 07799 { 07800 public: 07806 virtual void BSAPI_METHOD SetNCores(int cores = 1) = 0; 07812 virtual void BSAPI_METHOD SetAddNCoresToAutoDetect(int cores = 0) = 0; 07816 virtual int BSAPI_METHOD GetNCores() = 0; 07817 07818 }; 07819 07823 class SMulticoreVoicePrintExtractorI : public SVoicePrintExtractorI, public SMulticoreI 07824 { 07825 public: 07826 07827 virtual SVoicePrintExtractorI ** BSAPI_METHOD GetVPExtractors() = 0; 07828 }; 07829 07843 extern "C" SUnknownI *BSAPICreateInstance(unsigned int iId); 07844 07852 extern "C" const char *BSAPIInterfaceId2Text(unsigned int iId); 07853 07859 extern "C" unsigned int BSAPIText2InterfaceId(const char *pText); 07860 07866 extern "C" unsigned int BSAPITextInterfaceId2InterfaceId(const char *pTextId); 07867 07871 extern "C" const char *BSAPIVersion(); 07872 07876 extern "C" SLicenseManagerI *BSAPIGetLicenseManager(); 07877 07878 #endif
1.7.5.1