1 /* --------------------------------------------------------------- */ 2 /* The HMM-Based Speech Synthesis System (HTS): version 1.1b */ 3 /* HTS Working Group */ 4 /* */ 5 /* Department of Computer Science */ 6 /* Nagoya Institute of Technology */ 7 /* and */ 8 /* Interdisciplinary Graduate School of Science and Engineering */ 9 /* Tokyo Institute of Technology */ 10 /* Copyright (c) 2001-2003 */ 11 /* All Rights Reserved. */ 12 /* */ 13 /* Permission is hereby granted, free of charge, to use and */ 14 /* distribute this software and its documentation without */ 15 /* restriction, including without limitation the rights to use, */ 16 /* copy, modify, merge, publish, distribute, sublicense, and/or */ 17 /* sell copies of this work, and to permit persons to whom this */ 18 /* work is furnished to do so, subject to the following conditions: */ 19 /* */ 20 /* 1. The code must retain the above copyright notice, this list */ 21 /* of conditions and the following disclaimer. */ 22 /* */ 23 /* 2. Any modifications must be clearly marked as such. */ 24 /* */ 25 /* NAGOYA INSTITUTE OF TECHNOLOGY, TOKYO INSITITUTE OF TECHNOLOGY, */ 26 /* HTS WORKING GROUP, AND THE CONTRIBUTORS TO THIS WORK DISCLAIM */ 27 /* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL */ 28 /* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT */ 29 /* SHALL NAGOYA INSTITUTE OF TECHNOLOGY, TOKYO INSITITUTE OF */ 30 /* TECHNOLOGY, HTS WORKING GROUP, NOR THE CONTRIBUTORS BE LIABLE */ 31 /* FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY */ 32 /* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, */ 33 /* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTUOUS */ 34 /* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR */ 35 /* PERFORMANCE OF THIS SOFTWARE. */ 36 /* */ 37 /* --------------------------------------------------------------- */ 38 /* model.h : model definition */ 39 /* */ 40 /* 2003/06/11 by Heiga Zen */ 41 /* --------------------------------------------------------------- */ 42 43 typedef struct _Model { /* HMM handler */ 44 char *name; /* the name of this HMM */ 45 int durpdf; /* duration pdf index for this HMM */ 46 int *lf0pdf; /* mel-cepstrum pdf indexes for each state of this HMM */ 47 int *mceppdf; /* log f0 pdf indexes for each state of this HMM */ 48 int *dur; /* duration for each state of this HMM */ 49 int totaldur; /* total duration of this HMM */ 50 float **lf0mean; /* mean vector of log f0 pdfs for each state of this HMM */ 51 float **lf0variance; /* variance (diag) elements of log f0 for each state of this HMM */ 52 float **mcepmean; /* mean vector of mel-cepstrum pdfs for each state of this HMM */ 53 float **mcepvariance; /* variance (diag) elements of mel-cepstrum for each state of this HMM */ 54 HTS_Boolean *voiced; /* voiced/unvoiced decision for each state of this HMM */ 55 struct _Model *next; /* pointer to next HMM */ 56 } Model; 57 58 59 typedef struct _UttModel { /* Utterance model handler */ 60 Model *mhead; 61 Model *mtail; 62 int nModel; 63 int nState; 64 int totalframe; 65 } UttModel; 66 67 68 typedef struct _ModelSet { /* HMM set handler */ 69 int nstate; 70 int lf0stream; 71 int mcepvsize; 72 int ndurpdf; 73 int *nmceppdf; 74 int *nlf0pdf; 75 float **durpdf,***mceppdf,****lf0pdf; 76 FILE *fp[3]; 77 } ModelSet; 78 79 80 void LoadModelFiles (ModelSet *); 81 void FindDurPDF (Model *, ModelSet *, float, int ); 82 void FindLF0PDF (int, Model *, ModelSet *, float); 83 void FindMcpPDF (int, Model *, ModelSet *); 84 void InitModelSet (ModelSet *); 85 void DeleteModelSet(ModelSet *ms); 86 87 /* -------------------- End of "model.h" -------------------- */ 88