| 1 |
/*************************************************************************/ |
| 2 |
/* Cobalt Speech and Language, Inc */ |
| 3 |
/* Copyright (c) 2015 */ |
| 4 |
/* All Rights Reserved. */ |
| 5 |
/* */ |
| 6 |
/* Permission is hereby granted, free of charge, to use and distribute */ |
| 7 |
/* this software and its documentation without restriction, including */ |
| 8 |
/* without limitation the rights to use, copy, modify, merge, publish, */ |
| 9 |
/* distribute, sublicense, and/or sell copies of this work, and to */ |
| 10 |
/* permit persons to whom this work is furnished to do so, subject to */ |
| 11 |
/* the following conditions: */ |
| 12 |
/* 1. The code must retain the above copyright notice, this list of */ |
| 13 |
/* conditions and the following disclaimer. */ |
| 14 |
/* 2. Any modifications must be clearly marked as such. */ |
| 15 |
/* 3. Original authors' names are not deleted. */ |
| 16 |
/* 4. The authors' names are not used to endorse or promote products */ |
| 17 |
/* derived from this software without specific prior written */ |
| 18 |
/* permission. */ |
| 19 |
/* */ |
| 20 |
/* COBALT SPEECH AND LANGUAGE INC AND THE CONTRIBUTORS TO THIS WORK */ |
| 21 |
/* DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING */ |
| 22 |
/* ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT */ |
| 23 |
/* SHALL CARNEGIE MELLON UNIVERSITY NOR THE CONTRIBUTORS BE LIABLE */ |
| 24 |
/* FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES */ |
| 25 |
/* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN */ |
| 26 |
/* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, */ |
| 27 |
/* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF */ |
| 28 |
/* THIS SOFTWARE. */ |
| 29 |
/* */ |
| 30 |
/*************************************************************************/ |
| 31 |
/* Authors: Alok Parlikar ([email protected]) */ |
| 32 |
/* Date: December 2015 */ |
| 33 |
/* */ |
| 34 |
/* Thanks to VocaliD Inc. for supporting this work. */ |
| 35 |
/*************************************************************************/ |
| 36 |
// FliteCMUGenericCGObj.h : Declaration of the CFliteCMUGenericCGObj |
| 37 |
|
| 38 |
#pragma once |
| 39 |
#include "resource.h" // main symbols |
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
#include "FliteCMUGenericCG_i.h" |
| 44 |
#include "..\FliteTTSEngineObj\FliteTTSEngineObj.h" |
| 45 |
#include "flite_sapi_usenglish.h" |
| 46 |
|
| 47 |
//#define VOXNAME cmu_us_awb |
| 48 |
//#define REGISTER_VOX register_cmu_us_awb |
| 49 |
//#define UNREGISTER_VOX unregister_cmu_us_awb |
| 50 |
//#define VOXHUMAN "awb" |
| 51 |
//#define VOXGENDER "unknown" |
| 52 |
//#define VOXVERSION 1.0 |
| 53 |
|
| 54 |
|
| 55 |
extern "C" { |
| 56 |
cst_voice *REGISTER_VOX(const char *voxdir); |
| 57 |
void UNREGISTER_VOX(cst_voice *vox); |
| 58 |
|
| 59 |
void usenglish_init(cst_voice *v); |
| 60 |
cst_lexicon *cmulex_init(void); |
| 61 |
|
| 62 |
// Sai Krishna + Tim 13 March 2017 |
| 63 |
|
| 64 |
void cmu_indic_lang_init(cst_voice *v); |
| 65 |
cst_lexicon *cmu_indic_lex_init(void); |
| 66 |
|
| 67 |
void cmu_grapheme_lang_init(cst_voice *v); |
| 68 |
cst_lexicon *cmu_grapheme_lex_init(void); |
| 69 |
|
| 70 |
///////////////////////////////// |
| 71 |
}; |
| 72 |
|
| 73 |
class ATL_NO_VTABLE CFliteCMUGenericCGObj: |
| 74 |
public CComCoClass<CFliteCMUGenericCGObj, &CLSID_FliteCMUGenericCGObj>, |
| 75 |
public CFliteTTSEngineObj |
| 76 |
{ |
| 77 |
public: |
| 78 |
DECLARE_REGISTRY_RESOURCEID(IDR_FLITECMUGENERICCGOBJ) |
| 79 |
|
| 80 |
BEGIN_COM_MAP(CFliteCMUGenericCGObj) |
| 81 |
COM_INTERFACE_ENTRY(ISpTTSEngine) |
| 82 |
COM_INTERFACE_ENTRY(ISpObjectWithToken) |
| 83 |
END_COM_MAP() |
| 84 |
|
| 85 |
public: |
| 86 |
CFliteCMUGenericCGObj() { |
| 87 |
regfunc = REGISTER_VOX; |
| 88 |
unregfunc = UNREGISTER_VOX; |
| 89 |
phonemefunc = flite_sapi_usenglish_phoneme; |
| 90 |
visemefunc = flite_sapi_usenglish_viseme; |
| 91 |
featurefunc = flite_sapi_usenglish_feature; |
| 92 |
pronouncefunc = flite_sapi_usenglish_pronounce; |
| 93 |
} |
| 94 |
~CFliteCMUGenericCGObj() {} |
| 95 |
}; |
| 96 |
|
| 97 |
|
| 98 |
#if defined(_WIN32_WCE) && !defined(_CE_DCOM) && !defined(_CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA) |
| 99 |
#error "Single-threaded COM objects are not properly supported on Windows CE platform, such as the Windows Mobile platforms that do not include full DCOM support. Define _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA to force ATL to support creating single-thread COM object's and allow use of it's single-threaded COM object implementations. The threading model in your rgs file was set to 'Free' as that is the only threading model supported in non DCOM Windows CE platforms." |
| 100 |
#endif |
| 101 |
|
| 102 |
using namespace ATL; |