1 /*************************************************************************/
2 /*                                                                       */
3 /*                Centre for Speech Technology Research                  */
4 /*                 (University of Edinburgh, UK) and                     */
5 /*                           Korin Richmond                              */
6 /*                         Copyright (c) 2002                            */
7 /*                         All Rights Reserved.                          */
8 /*                                                                       */
9 /*  Permission is hereby granted, free of charge, to use and distribute  */
10 /*  this software and its documentation without restriction, including   */
11 /*  without limitation the rights to use, copy, modify, merge, publish,  */
12 /*  distribute, sublicense, and/or sell copies of this work, and to      */
13 /*  permit persons to whom this work is furnished to do so, subject to   */
14 /*  the following conditions:                                            */
15 /*                                                                       */
16 /*   1. The code must retain the above copyright notice, this list of    */
17 /*      conditions and the following disclaimer.                         */
18 /*   2. Any modifications must be clearly marked as such.                */
19 /*   3. Original authors' names are not deleted.                         */
20 /*   4. The authors' names are not used to endorse or promote products   */
21 /*      derived from this software without specific prior written        */
22 /*      permission.                                                      */
23 /*                                                                       */
24 /*  THE UNIVERSITY OF EDINBURGH AND THE CONTRIBUTORS TO THIS WORK        */
25 /*  DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING      */
26 /*  ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT   */
27 /*  SHALL THE UNIVERSITY OF EDINBURGH NOR THE CONTRIBUTORS BE LIABLE     */
28 /*  FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES    */
29 /*  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN   */
30 /*  AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,          */
31 /*  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF       */
32 /*  THIS SOFTWARE.                                                       */
33 /*                                                                       */
34 /*************************************************************************/
35 /*                                                                       */
36 /*                          Author: Korin Richmond                       */
37 /*                            Date:  Aug  2002                           */
38 /* --------------------------------------------------------------------- */
39 /* Abstract base class for "voices" - a top level interface to any code  */
40 /* which knows how to take a preprocessed utterance object and fill in   */
41 /* the information for subsequent synthesis by later festival modules    */
42 /*************************************************************************/
43 
44 
45 #ifndef __VOICEBASE_H__
46 #define __VOICEBASE_H__
47 
48 #include "EST_Val.h"
49 #include "EST_Val_defs.h"
50 
51 // EST_TKVL.h is necessary because of header dependencies
52 // which should probably be fixed at root, then this include
53 // could be removed...
54 #include "EST_TKVL.h"
55 #include "siod_defs.h"
56 
57 class EST_Utterance;
58 
59 class VoiceBase {
60 public:
VoiceBase()61   VoiceBase() : _verbosity(0), _name( EST_String::Empty ) {};
~VoiceBase()62   virtual ~VoiceBase() {};
63   virtual void initialise( bool ignore_bad_tag=false ) = 0;
64 
name()65   virtual EST_String name() { return _name; }
set_name(EST_String n)66   virtual void set_name(EST_String n) { _name = n;}
67 
setVerbosity(unsigned int level)68   virtual void setVerbosity( unsigned int level ) { _verbosity=level; }
verbosity()69   virtual unsigned int verbosity() const { return _verbosity; }
70 
71   //virtual bool synthesiseWave( EST_Utterance *utt ) = 0;
72   // this function should at best be moved to concatenative voice
73   // subclass and the above one implemented instead in order to
74   // generalise to non concatenative synthesis methods
75   virtual void getUnitSequence( EST_Utterance *utt )=0;
76 
77   virtual unsigned int numDatabaseUnits() const = 0;
78   virtual unsigned int numUnitTypes() const = 0;
79   virtual bool unitAvailable( const EST_String &unit ) const = 0;
80   virtual unsigned int numAvailableCandidates( const EST_String &unit ) const =0;
81 
82 
83 private:
84   //EST_Features params;
85   unsigned int _verbosity;
86   EST_String _name;
87 };
88 
89 SIOD_REGISTER_CLASS_DCLS(voice,VoiceBase)
90 VAL_REGISTER_CLASS_DCLS(voice,VoiceBase)
91 
92 
93 
94 /**@name Generalis[ed/able] notion of a "voice" within festival
95 */
96 
97 //@{
98 
99 /** Object oriented approach for better or for worse...
100 */
101 
102 #endif // __VOICEBASE_H__
103 
104