private void InitTTSObjects()
        {
            if (initFlag)
            {
                return;
            }
            initFlag = true;
            MBROLASynthesizerBase synth = (myEngine.Backend as MbrolaBackend).Synthesizer as MBROLASynthesizerBase;

            acmds = new PointPairList();
            pcmds = new PointPairList();
            pitch = new PointPairList();
            pcomp = new PointPairList();

            FujisakiProcessor fujisaki = (myEngine.Frontend as StandardFrontend).FujisakiProcessor;
            Parser            parser   = (myEngine.Frontend as StandardFrontend).Parser;

            fujisaki.PhraseCommand           += OnPhraseCommand;
            fujisaki.AccentCommand           += OnAccentCommand;
            fujisaki.PitchPointComputed      += OnPitchPoint;
            fujisaki.PhraseComponentComputed += OnPhraseComponent;
            fujisaki.NoMoreData += delegate { updateGraph(fujisakiForm.zedGraphControl1); };

            translit = new TranslitListener(parser);
            translit.TranslitUpdated   += new StringEventHandler(translit_TranslitUpdated);
            mbrolaListener              = new MBROLAListener(synth);
            mbrolaListener.TextUpdated += new StringEventHandler(mbrolaListener_TextUpdated);
        }
Exemple #2
0
        private void InitTTSObjects()
        {
            toolStripStatusLabel1.BackColor = toolStripStatusLabel2.BackColor = toolStripStatusLabel3.BackColor = toolStripStatusLabel4.BackColor = toolStripStatusLabel5.BackColor = toolStripStatusLabel6.BackColor = toolStripStatusLabel7.BackColor = toolStripStatusLabel8.BackColor = Color.Green;

            tokenizer = new Tokenizer();
            tokenizer.DoneProducing += OnDoneProducing;
            parser = new Parser();
            parser.DoneProducing     += OnDoneProducing;
            segmenter                 = new Segmenter();
            segmenter.DoneProducing  += OnDoneProducing;
            phonetizer                = new Phonetizer();
            phonetizer.DoneProducing += OnDoneProducing;
            translator                = new MBROLATranslator();
            translator.DoneProducing += OnDoneProducing;
            synth = new MBROLASynthesizer();
            synth.DoneProducing += OnDoneProducing;

            acmds = new PointPairList();
            pcmds = new PointPairList();
            pitch = new PointPairList();
            pcomp = new PointPairList();

            //            fujisaki = new FujisakiProcessor();
            fujisaki.Model.alpha = Settings.Default.FujisakiAlpha;
            fujisaki.Model.beta  = Settings.Default.FujisakiBeta;
            fujisaki.Model.gamma = Settings.Default.FujisakiGamma;
            fujisaki.Model.Fb    = Settings.Default.FujisakiFb;
            fujisaki.Reset();

            fujisaki.DoneProducing += OnDoneProducing;

            fujisaki.PhraseCommand           += OnPhraseCommand;
            fujisaki.AccentCommand           += OnAccentCommand;
            fujisaki.PitchPointComputed      += OnPitchPoint;
            fujisaki.PhraseComponentComputed += OnPhraseComponent;
            fujisaki.NoMoreData += delegate { updateGraph(fujisakiForm.zedGraphControl1); };

            translator.Voice            = synth.Voice = Voices[toolStripComboBox1.SelectedIndex];
            segmenter.RelaxAudibleSchwa = Settings.Default.RelaxAudibleSchwa;
            phonetizer.Options.DistinguishStrongDagesh = Settings.Default.DistinguishStrongDagesh;
            phonetizer.Options.Akanye = phonetizer.Options.Ikanye = Settings.Default.AkanyeIkanye;
            //            phonetizer.Options.SingCantillation = checkedListBox1.GetItemChecked(5);
            parser.Options.EverydayRegister = Settings.Default.EverydayRegister;

            if (Settings.Default.Milel)
            {
                segmenter.DefaultStress = Word.Stress.Milel;
            }
            else
            {
                segmenter.DefaultStress = Word.Stress.Milra;
            }
            TranslitListener translit = new TranslitListener(parser);

            translit.TranslitUpdated += new StringEventHandler(translit_TranslitUpdated);
            MBROLAListener mbrolaListener = new MBROLAListener(synth);

            mbrolaListener.TextUpdated += new StringEventHandler(mbrolaListener_TextUpdated);
        }