private void UpdateTTSOptions() { translit.Clear(); mbrolaListener.Clear(); acmds.Clear(); pcmds.Clear(); pitch.Clear(); pcomp.Clear(); FujisakiProcessor fujisaki = (myEngine.Frontend as StandardFrontend).FujisakiProcessor; Segmenter segmenter = (myEngine.Frontend as StandardFrontend).Segmenter; Phonetizer phonetizer = (myEngine.Frontend as StandardFrontend).Phonetizer; Parser parser = (myEngine.Frontend as StandardFrontend).Parser; fujisaki.Model.alpha = Settings.Default.FujisakiAlpha; fujisaki.Model.beta = Settings.Default.FujisakiBeta; fujisaki.Model.gamma = Settings.Default.FujisakiGamma; fujisaki.Model.Fb = Settings.Default.FujisakiFb; 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; } }
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); }
public void TestSimpleGerman2() { Phonetizer p = new Phonetizer(); p.Rules = RuleLoader.LoadFromRessource("phonet4n.Core.german_2.csv"); Assert.AreEqual(919 * 3, p.Rules.Length); Assert.AreEqual("NEIA", p.Phonetize("Meier")); Assert.AreEqual("NEIA", p.Phonetize("Mayer")); Assert.AreEqual("FEIFA", p.Phonetize("Pfeiffer")); Assert.AreEqual("FEIFA", p.Phonetize("Pfeifer")); }
public void TestRecurringDigits_Strip() { Phonetizer p = new Phonetizer(false); p.Rules = RuleLoader.LoadFromRessource("phonet4n.Core.german_1.csv"); Assert.AreEqual(919 * 3, p.Rules.Length); Assert.AreEqual("TEST01", p.Phonetize("Teest01")); Assert.AreEqual("TEST01", p.Phonetize("Teest001")); Assert.AreEqual("0123456789", p.Phonetize("00112233445566778899")); Assert.AreEqual("0", p.Phonetize("0000")); }
void ITTSCentral.TextData(VOICECHARSET eCharacterSet, uint dwFlags, SDATA dText, object pNotifyInterface, Guid IIDNotifyInterface) { try { miniLog("TextData " + dText.AsString); StringCharProducer scp = new StringCharProducer(dText.AsString); Tokenizer tokenizer = new Tokenizer(); Parser parser = new Parser(); Segmenter segmenter = new Segmenter(); Phonetizer phonetizer = new Phonetizer(); FujisakiProcessor fujisaki = new FujisakiProcessor(); MBROLATranslator translator = new MBROLATranslator(); MBROLASynthesizer synthesizer = new MBROLASynthesizer(); synthesizer.Voice = translator.Voice = modeInfo.Voice; tokenizer.Run(scp); parser.Run(tokenizer); segmenter.Run(parser); phonetizer.Run(segmenter); fujisaki.Run(phonetizer); translator.Run(fujisaki); synthesizer.Run(translator); /* DelegateConsumer<MBROLAElement> delegc = new DelegateConsumer<MBROLAElement>(); * delegc.ItemConsumed += delegate(MBROLAElement item) * { * miniLog("dummy sees: " + item.ToString()); * }; * delegc.Run(translator); * delegc.Join();*/ Sapi4AudioTarget target = new Sapi4AudioTarget(audioObject); target.Run(synthesizer); } catch (Exception e) { Sapi4Engine.miniLog(e + ": " + e.Message); } }
public void Setup() { adapter = new CImplAdapter(); phonetizer = new Phonetizer(); }
public override void SetUp() { base.SetUp(); phonetizer = new Phonetizer(); }