Config.h

Go to the documentation of this file.
00001 /*
00002         This file is part of ALIZE which is an open-source tool for 
00003         speaker recognition.
00004 
00005     ALIZE is free software: you can redistribute it and/or modify
00006     it under the terms of the GNU Lesser General Public License as 
00007     published by the Free Software Foundation, either version 3 of 
00008     the License, or any later version.
00009 
00010     ALIZE is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013     GNU Lesser General Public License for more details.
00014 
00015     You should have received a copy of the GNU Lesser General Public 
00016     License along with ALIZE.
00017     If not, see <http://www.gnu.org/licenses/>.
00018         
00019         ALIZE is a development project initiated by the ELISA consortium
00020         [alize.univ-avignon.fr/] and funded by the French Research 
00021         Ministry in the framework of the TECHNOLANGUE program 
00022         [www.technolangue.net]
00023 
00024         The ALIZE project team wants to highlight the limits of voice
00025         authentication in a forensic context.
00026         The "Person  Authentification by Voice: A Need of Caution" paper 
00027         proposes a good overview of this point (cf. "Person  
00028         Authentification by Voice: A Need of Caution", Bonastre J.F., 
00029         Bimbot F., Boe L.J., Campbell J.P., Douglas D.A., Magrin-
00030         chagnolleau I., Eurospeech 2003, Genova].
00031         The conclusion of the paper of the paper is proposed bellow:
00032         [Currently, it is not possible to completely determine whether the 
00033         similarity between two recordings is due to the speaker or to other 
00034         factors, especially when: (a) the speaker does not cooperate, (b) there 
00035         is no control over recording equipment, (c) recording conditions are not 
00036         known, (d) one does not know whether the voice was disguised and, to a 
00037         lesser extent, (e) the linguistic content of the message is not 
00038         controlled. Caution and judgment must be exercised when applying speaker 
00039         recognition techniques, whether human or automatic, to account for these 
00040         uncontrolled factors. Under more constrained or calibrated situations, 
00041         or as an aid for investigative purposes, judicious application of these 
00042         techniques may be suitable, provided they are not considered as infallible.
00043         At the present time, there is no scientific process that enables one to 
00044         uniquely characterize a person=92s voice or to identify with absolute 
00045         certainty an individual from his or her voice.]
00046         Contact Jean-Francois Bonastre for more information about the licence or
00047         the use of ALIZE
00048 
00049         Copyright (C) 2003-2010
00050         Laboratoire d'informatique d'Avignon [lia.univ-avignon.fr]
00051         ALIZE admin [alize@univ-avignon.fr]
00052         Jean-Francois Bonastre [jean-francois.bonastre@univ-avignon.fr]
00053 */
00054 
00055 #if !defined(ALIZE_Config_h)
00056 #define ALIZE_Config_h
00057 
00058 #if defined(_WIN32)
00059 #if defined(ALIZE_EXPORTS)
00060 #define ALIZE_API __declspec(dllexport)
00061 #else
00062 #define ALIZE_API __declspec(dllimport)
00063 #endif
00064 #else
00065 #define ALIZE_API
00066 #endif
00067 
00068 #include "Object.h"
00069 #include "FeatureFlags.h"
00070 #include "XList.h"
00071 
00072 namespace alize
00073 {
00084   class ALIZE_API Config : public Object
00085   {
00086     friend class TestConfig;
00087 
00088   public :
00089 
00090     Config();
00091 
00095     explicit Config(const FileName& f);
00096 
00097     Config(const Config&);
00098     const Config& operator=(const Config& c);
00099     bool operator==(const Config& c) const;
00100     bool operator!=(const Config& c) const;
00101     virtual ~Config();
00102     
00108     void save(const FileName& f) const;
00109 
00115     void load(const FileName& f);
00116 
00119     void reset();
00120 
00124     unsigned long getParamCount() const;
00125 
00130     const String& getParamName(unsigned long) const;
00131 
00136     const String& getParamContent(unsigned long) const;
00137 
00140     void setParam(const String& name, const String& content);
00141 
00144     void setParam(const Config& c);
00145 
00148     const String& getParam(const String& name) const;
00149 
00152     long getIntegerParam(const String& name) const;
00153 
00156     double getFloatParam(const String& name) const;
00157 
00160     bool getBooleanParam(const String& name) const;
00161 
00164     bool existsParam(const String& name) const;
00165 
00166     //------------------------------------------------------------------
00167 
00170     real_t getParam_minCov() const;
00171 
00174     unsigned long getParam_vectSize() const;
00175 
00178     bool getParam_computeLLKWithTopDistribs() const;
00179 
00181     bool getParam_debug() const;
00182 
00185     unsigned long getParam_topDistribsCount() const;
00186 
00189     unsigned long getParam_mixtureDistribCount() const;
00190 
00193     lk_t getParam_minLLK() const;
00194 
00197     lk_t getParam_maxLLK() const;
00198 
00201     DistribType getParam_distribType() const;
00202 
00205     MixtureFileWriterFormat getParam_saveMixtureFileFormat() const;
00206 
00209     MixtureServerFileWriterFormat getParam_saveMixtureServerFileFormat() const;
00210 
00213     SegServerFileWriterFormat getParam_saveSegServerFileFormat() const;
00214 
00215 
00216     //------------------------------------------------------------------
00217     // Features
00218     //------------------------------------------------------------------
00219 
00220 
00223     const FeatureFlags& getParam_featureFlags() const;
00224     
00228     const String& getParam_featureServerBufferSize() const;
00229     
00233     const String& getParam_featureServerMask() const;
00234 
00237     const String& getParam_featureFilesPath() const;
00238 
00241     const String& getParam_audioFilesPath() const;
00242 
00245     unsigned long getParam_loadFeatureFileMemAlloc() const;
00246 
00249     unsigned long getParam_featureServerMemAlloc() const;
00250 
00253     FeatureFileReaderFormat getParam_loadFeatureFileFormat() const;
00254 
00257     unsigned long getParam_loadFeatureFileVectSize() const;
00258 
00261     unsigned long getParam_loadAudioFileChannel() const;
00262 
00265     const String& getParam_loadFeatureFileExtension() const;
00266 
00269     const String& getParam_loadAudioFileExtension() const;
00270 
00273     bool getParam_loadFeatureFileBigEndian() const;
00274 
00277     bool getParam_loadAudioFileBigEndian() const;
00278 
00281     const String& getParam_featureServerMode() const;
00282 
00285     bool getParam_loadMixtureFileBigEndian() const;
00286 
00289     FeatureFileWriterFormat getParam_saveFeatureFileFormat() const;
00290 
00293     const String& getParam_saveFeatureFileExtension() const;
00294 
00297     SPRO3DataKind getParam_saveFeatureFileSPro3DataKind() const;
00298 
00299     //------------------------------------------------------------------
00300 
00301 
00304     MixtureFileReaderFormat getParam_loadMixtureFileFormat() const;
00305 
00308     SegServerFileReaderFormat getParam_loadSegServerFileFormat() const;
00309 
00312     const String& getParam_loadMixtureFileExtension() const;
00313 
00316     const String& getParam_loadSegServerFileExtension() const;
00317 
00320     const String& getParam_saveMixtureFileExtension() const;
00321 
00324     const String& getParam_saveMixtureServerFileExtension() const;
00325 
00328     const String& getParam_saveSegServerFileExtension() const;
00329 
00332     const String& getParam_mixtureFilesPath() const;
00333 
00336     const String& getParam_segServerFilesPath() const;
00337 
00340     bool getParam_bigEndian() const;
00341 
00344     real_t getParam_sampleRate() const;
00345 
00346     virtual String getClassName() const;
00347     virtual String toString() const;
00348 
00349     bool  existsParam_minCov;
00350     bool  existsParam_vectSize;
00351     bool  existsParam_loadFeatureFileMemAlloc;
00352     bool  existsParam_featureServerMemAlloc;
00353     bool  existsParam_computeLLKWithTopDistribs;
00354     bool  existsParam_debug;
00355     bool  existsParam_topDistribsCount;
00356     bool  existsParam_featureServerBufferSize;
00357     bool  existsParam_featureServerMask;
00358     bool  existsParam_featureFlags;
00359     bool  existsParam_mixtureDistribCount;
00360     bool  existsParam_minLLK;
00361     bool  existsParam_maxLLK;
00362     bool  existsParam_distribType;
00363 
00364     bool  existsParam_saveMixtureFileFormat;
00365     bool  existsParam_saveMixtureServerFileFormat;
00366     bool  existsParam_saveSegServerFileFormat;
00367     bool  existsParam_saveFeatureFileFormat;
00368     bool  existsParam_saveFeatureFileSPro3DataKind;
00369     bool  existsParam_loadFeatureFileFormat;
00370     bool  existsParam_loadFeatureFileVectSize;
00371     bool  existsParam_loadAudioFileChannel;
00372     bool  existsParam_loadMixtureFileFormat;
00373     bool  existsParam_loadSegServerFileFormat;
00374     bool  existsParam_saveMixtureFileExtension;
00375     bool  existsParam_saveMixtureServerFileExtension;
00376     bool  existsParam_saveSegServerFileExtension;
00377     bool  existsParam_saveFeatureFileExtension;
00378     bool  existsParam_loadFeatureFileExtension;
00379     bool  existsParam_loadAudioFileExtension;
00380     bool  existsParam_loadFeatureFileBigEndian;
00381     bool  existsParam_loadAudioFileBigEndian;
00382     bool  existsParam_featureServerMode;
00383     bool  existsParam_loadMixtureFileBigEndian;
00384     bool  existsParam_loadMixtureFileExtension;
00385     bool  existsParam_loadSegServerFileExtension;
00386     bool  existsParam_bigEndian;
00387     bool  existsParam_sampleRate;
00388     bool  existsParam_featureFilesPath;
00389     bool  existsParam_audioFilesPath;
00390     bool  existsParam_segServerFilesPath;
00391     bool  existsParam_mixtureFilesPath;
00392 
00393   private :
00394     real_t              _param_minCov;
00395     unsigned long       _param_vectSize;
00396     unsigned long       _param_loadFeatureFileMemAlloc;
00397     unsigned long       _param_featureServerMemAlloc;
00398     bool                _param_computeLLKWithTopDistribs;
00399     bool                _param_debug;
00400     unsigned long       _param_topDistribsCount;
00401     String              _param_featureServerBufferSize; // can be a number
00402                                // or "ALL_FEATURES"
00403     String              _param_featureServerMask;
00404     FeatureFlags        _param_featureFlags;
00405     unsigned long       _param_mixtureDistribCount;
00406     MixtureFileWriterFormat _param_saveMixtureFileFormat;
00407     MixtureServerFileWriterFormat _param_saveMixtureServerFileFormat;
00408     SegServerFileWriterFormat _param_saveSegServerFileFormat;
00409     String              _param_saveMixtureFileExtension;
00410     String              _param_saveMixtureServerFileExtension;
00411     String              _param_saveSegServerFileExtension;
00412     MixtureFileReaderFormat _param_loadMixtureFileFormat;
00413     SegServerFileReaderFormat _param_loadSegServerFileFormat;
00414     String              _param_loadMixtureFileExtension;
00415     String              _param_loadSegServerFileExtension;
00416     String              _param_mixtureFilesPath;
00417     FeatureFileWriterFormat _param_saveFeatureFileFormat;
00418     SPRO3DataKind       _param_saveFeatureFileSPro3DataKind;
00419     String              _param_saveFeatureFileExtension;
00420     FeatureFileReaderFormat _param_loadFeatureFileFormat;
00421     unsigned long _param_loadFeatureFileVectSize;
00422     unsigned long _param_loadAudioFileChannel;
00423     String              _param_loadFeatureFileExtension;
00424     String              _param_loadAudioFileExtension;
00425     bool                _param_loadFeatureFileBigEndian;
00426     bool                _param_loadAudioFileBigEndian;
00427     String              _param_featureServerMode;
00428     bool                _param_loadMixtureFileBigEndian;
00429     String              _param_featureFilesPath;
00430     String              _param_audioFilesPath;
00431     String              _param_segServerFilesPath;
00432     lk_t         _param_minLLK;
00433     lk_t         _param_maxLLK;
00434     DistribType  _param_distribType;
00435     bool         _param_bigEndian;
00436     real_t       _param_sampleRate;
00437 
00438     XList        _set;
00439 
00440     void assign(const Config&);
00441     void err(const String&) const;
00442   };
00443 
00444 } // end namespace alize
00445 
00446 #endif // !defined(ALIZE_Config_h)