| 1 |
/////////////////////////////////////////////////////////////////////////// |
| 2 |
// // |
| 3 |
// Cepstral, LLC // |
| 4 |
// Copyright (c) 2001 // |
| 5 |
// All Rights Reserved. // |
| 6 |
// // |
| 7 |
// Permission is hereby granted, free of charge, to use and distribute // |
| 8 |
// this software and its documentation without restriction, including // |
| 9 |
// without limitation the rights to use, copy, modify, merge, publish, // |
| 10 |
// distribute, sublicense, and/or sell copies of this work, and to // |
| 11 |
// permit persons to whom this work is furnished to do so, subject to // |
| 12 |
// the following conditions: // |
| 13 |
// 1. The code must retain the above copyright notice, this list of // |
| 14 |
// conditions and the following disclaimer. // |
| 15 |
// 2. Any modifications must be clearly marked as such. // |
| 16 |
// 3. Original authors' names are not deleted. // |
| 17 |
// 4. The authors' names are not used to endorse or promote products // |
| 18 |
// derived from this software without specific prior written // |
| 19 |
// permission. // |
| 20 |
// // |
| 21 |
// CEPSTRAL, LLC AND THE CONTRIBUTORS TO THIS WORK DISCLAIM ALL // |
| 22 |
// WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED // |
| 23 |
// WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL // |
| 24 |
// CEPSTRAL, LLC NOR THE CONTRIBUTORS BE LIABLE FOR ANY SPECIAL, // |
| 25 |
// INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER // |
| 26 |
// RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION // |
| 27 |
// OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR // |
| 28 |
// IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. // |
| 29 |
// // |
| 30 |
/////////////////////////////////////////////////////////////////////////// |
| 31 |
// Author: David Huggins-Daines ([email protected]) // |
| 32 |
// Date: November 2001 // |
| 33 |
/////////////////////////////////////////////////////////////////////////// |
| 34 |
|
| 35 |
#include <atlbase.h> |
| 36 |
#include <stdio.h> |
| 37 |
#include <sphelper.h> |
| 38 |
|
| 39 |
/* CHANGEME: Include the _i.c file for your voice here instead. */ |
| 40 |
#include "../FliteCMUKalDiphone_i.c" |
| 41 |
|
| 42 |
int wmain(int argc, WCHAR *argv[]) |
| 43 |
{ |
| 44 |
USES_CONVERSION; |
| 45 |
HRESULT hr; |
| 46 |
|
| 47 |
::CoInitialize(NULL); |
| 48 |
|
| 49 |
ISpObjectToken *cpToken; |
| 50 |
ISpDataKey *cpDataKeyAttribs; |
| 51 |
|
| 52 |
hr = SpCreateNewTokenEx( |
| 53 |
SPCAT_VOICES, |
| 54 |
|
| 55 |
/* CHANGEME: Change the following five arguments for your voice. */ |
| 56 |
L"CMUKal", /* A unique name for your voice. */ |
| 57 |
&CLSID_FliteCMUKalDiphoneObj, /* The CLSID for your voice object. */ |
| 58 |
L"CMU Kal Diphone Voice", /* Language-independent full name. */ |
| 59 |
0x409, /* Language ID (US English is 0x409) */ |
| 60 |
L"CMU Kal Diphone Voice", /* Language-dependent full name. */ |
| 61 |
|
| 62 |
&cpToken, |
| 63 |
&cpDataKeyAttribs); |
| 64 |
|
| 65 |
//--- Set additional attributes for searching and the path to the |
| 66 |
// voice data file we just created. |
| 67 |
if (SUCCEEDED(hr)) |
| 68 |
{ |
| 69 |
/* CHANGEME: The gender of your speaker. */ |
| 70 |
hr = cpDataKeyAttribs->SetStringValue(L"Gender", |
| 71 |
L"Male"); |
| 72 |
|
| 73 |
/* CHANGEME: The name of your speaker. */ |
| 74 |
if (SUCCEEDED(hr)) |
| 75 |
hr = cpDataKeyAttribs->SetStringValue(L"Name", |
| 76 |
L"CMU Kal Diphone"); |
| 77 |
|
| 78 |
/* CHANGEME: The language IDs supported by your voice. */ |
| 79 |
if (SUCCEEDED(hr)) |
| 80 |
hr = cpDataKeyAttribs->SetStringValue(L"Language", |
| 81 |
/* US English; |
| 82 |
English */ |
| 83 |
L"409;9"); |
| 84 |
|
| 85 |
/* CHANGEME: The general age of your speaker (Adult, Child). */ |
| 86 |
if (SUCCEEDED(hr)) |
| 87 |
hr = cpDataKeyAttribs->SetStringValue(L"Age", |
| 88 |
L"Adult"); |
| 89 |
|
| 90 |
/* CHANGEME: The vendor name for your voice. */ |
| 91 |
if (SUCCEEDED(hr)) |
| 92 |
hr = cpDataKeyAttribs->SetStringValue(L"Vendor", |
| 93 |
L"CMU"); |
| 94 |
} |
| 95 |
::CoUninitialize(); |
| 96 |
|
| 97 |
if (FAILED(hr)) { |
| 98 |
fprintf(stderr, "SpCreateNewTokenEx failed, code %x\n", |
| 99 |
FAILED(hr)); |
| 100 |
return FAILED(hr); |
| 101 |
} |
| 102 |
|
| 103 |
return 0; |
| 104 |
} |