예제 #1
0
파일: Courbe.java 프로젝트: Chiwan/Devint
 /**
  * Pour construire une courbe constante
  *
  * @author Ecole Polytechnique de Sophia Antipolis
  * @param s le syntagme associe
  */
 public Courbe(Syntagme s) {
   this(
       s,
       Integer.parseInt(ConfigFile.rechercher("FREQUENCE_INIT")),
       -1,
       Integer.parseInt(ConfigFile.rechercher("HAUTEUR_PALIER")));
 }
예제 #2
0
파일: Courbe.java 프로젝트: Chiwan/Devint
 /**
  * Calcul du point suivant, pour une courbe de type B
  *
  * @author Ecole Polytechnique de Sophia Antipolis
  * @return la valeur ad'hoc
  */
 private int valueB() {
   double d = (double) (xn - nbPoint);
   return (int)
       (frequenceInit
           + Integer.parseInt(ConfigFile.rechercher("COEFF_HAUTEUR_B")) * hauteurNiveau
           + coeffk * Math.pow(d, Integer.parseInt(ConfigFile.rechercher("PUISSANCE_B"))));
 }
예제 #3
0
파일: Courbe.java 프로젝트: Chiwan/Devint
 /**
  * Calcul du point suivant, pour une courbe de type E
  *
  * @author Ecole Polytechnique de Sophia Antipolis
  * @return la valeur ad'hoc
  */
 private int valueE() {
   return (int)
       (frequenceInit
           + Integer.parseInt(ConfigFile.rechercher("COEFF_HAUTEUR_E")) * hauteurNiveau
           - Integer.parseInt(ConfigFile.rechercher("COEFF_H_N-1_E"))
               * hauteurNiveau
               * (xn - 1)
               / (nbPoint - 1));
 }
예제 #4
0
 /**
  * Pour lire un texte court (sans ponctuation) à voix haute
  *
  * @param text, chaîne de caractères à lire à voix haute
  */
 public void playShortText(String text) {
   if (!on) return;
   an = new Analyser(text, prosodie);
   Vector<Phoneme> listePhonemes = an.analyserGroupes();
   s =
       new SynthetiseurMbrola(
           lt.getVoix(),
           ConfigFile.rechercher("REPERTOIRE_PHO_WAV"),
           ConfigFile.rechercher("FICHIER_PHO_WAV"));
   s.play();
   sjoue = true;
 }
예제 #5
0
파일: Courbe.java 프로젝트: Chiwan/Devint
 /**
  * Calcul du point suivant, pour une courbe de type C
  *
  * @author Ecole Polytechnique de Sophia Antipolis
  * @return la valeur ad'hoc
  */
 private int valueC() {
   double r =
       Math.pow(
           (double) (xn - 1) / (nbPoint - 1),
           Integer.parseInt(ConfigFile.rechercher("PUISSANCE_C")));
   return (int)
       (frequenceInit
           + Integer.parseInt(ConfigFile.rechercher("COEFF_HAUTEUR_C")) * hauteurNiveau
           - Integer.parseInt(ConfigFile.rechercher("COEFF_H_SQRT_C"))
               * hauteurNiveau
               * Math.sqrt(1 - r));
 }
예제 #6
0
 // appelé par loopText et playText avec valeur flagloop différente
 public void play(String text, boolean flagloop) {
   if (!on) return;
   an = new Analyser(text, prosodie);
   Vector<Phoneme> listePhonemes = an.analyserGroupes();
   s =
       new SynthetiseurMbrola(
           lt.getVoix(),
           ConfigFile.rechercher("REPERTOIRE_PHO_WAV"),
           ConfigFile.rechercher("FICHIER_PHO_WAV"));
   // System.out.println("RAPIDITE: "+ConfigFile.rechercher("RAPIDITE"));
   if (flagloop) s.loop();
   else s.play();
   sjoue = true;
 }
예제 #7
0
파일: Courbe.java 프로젝트: Chiwan/Devint
 /**
  * Constructeur par defaut
  *
  * @author Ecole Polytechnique de Sophia Antipolis
  * @param s le syntagme associe a la courbe
  * @param f la frequence initiale de la courbe
  * @param n le nombre de points utilise par la courbe
  * @param h la hauteur entre les 4 niveaux des courbes
  */
 public Courbe(Syntagme s, int f, int n, int h) {
   synt = s;
   frequenceInit = f;
   nbPoint = n;
   hauteurNiveau = h;
   if (s.mineur())
     coeffk =
         -(Integer.parseInt(ConfigFile.rechercher("COEFF_K_MINEUR")) * h) / Math.pow(1 - n, 2);
   else if (s.majeur())
     coeffk =
         -(Integer.parseInt(ConfigFile.rechercher("COEFF_K_MAJEUR")) * h) / Math.pow(1 - n, 2);
   else coeffk = 0;
   xn = 0;
 }
예제 #8
0
 /**
  * Pour fixer la voix utilisée si la synthèse parle
  *
  * @param voix, de 1 à 7
  */
 public void setVoix(int voix) {
   int vox;
   int nbvoix =
       Integer.parseInt(
           ConfigFile.rechercher("NBVOIX")); // nombre de voix disponibles dans ressources
   System.out.println(nbvoix);
   vox = (voix > nbvoix) ? nbvoix : voix;
   vox = (voix < 1) ? 1 : voix;
   lt.setVoix(vox);
 }
예제 #9
0
 /**
  * Constructeur pour fixer la voix
  *
  * @param voix, de 1 à 7 pour fr1, fr2, ... fr7
  */
 public SIVOXDevint(int voix) {
   int vox;
   int nbvoix = Integer.parseInt(ConfigFile.rechercher("NBVOIX")); // nombre de voix disponibles
   System.out.println(nbvoix);
   jk = null;
   sjoue = false;
   on = true;
   prosodie = 3; // la meilleure prosodie
   vox = (voix > nbvoix) ? nbvoix : voix;
   vox = (voix < 1) ? 1 : voix;
   lt.setVoix(vox);
 }
예제 #10
0
파일: Courbe.java 프로젝트: Chiwan/Devint
 /**
  * Pour obtenir la prochaine valeur de la courbe (iterateur)
  *
  * @author Ecole Polytechnique de Sophia Antipolis
  * @return l'entier correspondant
  */
 public int nextValue() {
   if (xn == -1) {
     if (synt.finExclam())
       return frequenceInit
           + Integer.parseInt(ConfigFile.rechercher("COEFF_EXCLAMATION")) * hauteurNiveau;
     else return frequenceInit + hauteurNiveau;
   } else {
     xn++;
     if (synt.mineur()) return valueA();
     if (synt.majeur()) return valueB();
     if (synt.finInterro()) return valueC();
     if (synt.finExclam()) return valueE();
     return valueD();
   }
 }