Beispiel #1
0
        private void ResetParameters(Val_Talker val_, Dictionary <string, WPFSlider> _interface)
        {
            TalkerPrimitive defaultParam = talkerDefaultParamList[val_.talkerRealName];

            AvatorParam_VREX avator = AvatorParams[ConvertNametoIndex(val_)] as AvatorParam_VREX;


            foreach (KeyValuePair <string, EffectValueInfo> val__ in defaultParam.VoiceEffects)
            {
                FormsTextBox TargetTextBox = null;
                double       value         = 0.00;
                if (val__.Key == "音量")
                {
                    TargetTextBox = avator.AvatorUI.VolumeText;
                    value         = (double)val__.Value.val;
                }
                else if (val__.Key == "話速")
                {
                    TargetTextBox = avator.AvatorUI.SpeedText;
                    value         = (double)val__.Value.val;
                }
                else if (val__.Key == "高さ")
                {
                    TargetTextBox = avator.AvatorUI.PitchText;
                    value         = (double)val__.Value.val;
                }
                else if (val__.Key == "抑揚")
                {
                    TargetTextBox = avator.AvatorUI.IntonationText;
                    value         = (double)val__.Value.val;
                }
                else
                {
                    break;
                }


                if (TargetTextBox != null)
                {
                    TargetTextBox.EmulateChangeText(string.Format("{0:0.00}", value));
                }
            }
        }
Beispiel #2
0
        public int ScanTalker(ArrayList talkerlist, System.Windows.Forms.TextBox log)
        {
            IsAlive = false;

            foreach (AvatorParam_VREX avator in GetVoiceroidProcess())
            {
                AvatorParams.Add(avator.AvatorIndex, avator);
                gyakubiki.Add(avator.AvatorName, avator.AvatorIndex);

                avator.AvatorUI = new AvatorUIParam_VREX();
                var talker = new TalkerPrimitive();


                try
                {
                    avator.AvatorUI._app      = avator.AvatorProcess;
                    avator.AvatorUI.uiTreeTop = WindowControl.FromZTop(avator.AvatorUI._app);

                    // Zインデクスはコーディア様の TestAssistantで確認可能。音声効果タブへ切り替えてUI要素を取得する。
                    dynamic VoiceroidExUiTab = new FormsTabControl(avator.AvatorUI.uiTreeTop.IdentifyFromZIndex(2, 0, 0, 0, 0));
                    VoiceroidExUiTab.EmulateTabSelect(2);

                    avator.AvatorUI.TalkTextBox    = avator.AvatorUI.uiTreeTop.IdentifyFromZIndex(2, 0, 0, 1, 0, 1, 1);
                    avator.AvatorUI.PlayButton     = new FormsButton(avator.AvatorUI.uiTreeTop.IdentifyFromZIndex(2, 0, 0, 1, 0, 1, 0, 3));
                    avator.AvatorUI.SaveButton     = new FormsButton(avator.AvatorUI.uiTreeTop.IdentifyFromZIndex(2, 0, 0, 1, 0, 1, 0, 1));
                    avator.AvatorUI.VolumeText     = new FormsTextBox(avator.AvatorUI.uiTreeTop.IdentifyFromZIndex(2, 0, 0, 0, 0, 0, 0, 8));
                    avator.AvatorUI.SpeedText      = new FormsTextBox(avator.AvatorUI.uiTreeTop.IdentifyFromZIndex(2, 0, 0, 0, 0, 0, 0, 9));
                    avator.AvatorUI.PitchText      = new FormsTextBox(avator.AvatorUI.uiTreeTop.IdentifyFromZIndex(2, 0, 0, 0, 0, 0, 0, 10));
                    avator.AvatorUI.IntonationText = new FormsTextBox(avator.AvatorUI.uiTreeTop.IdentifyFromZIndex(2, 0, 0, 0, 0, 0, 0, 11));
                }
                catch (Exception e)
                {
                    //                    ThrowException(string.Format(@"{0} {1}", e.Message, e.StackTrace));
                    MessageBox.Show(string.Format(@"{0} {1}", e.Message, e.StackTrace));
                }

                avator.VoiceEffects_default = new Dictionary <EnumVoiceEffect, EffectValueInfo>
                {
                    { EnumVoiceEffect.volume, new EffectValueInfo(GetSliderValue(avator.AvatorIndex, EnumVoiceEffect.volume), 0.0m, 2.0m, 0.01m) },
                    { EnumVoiceEffect.speed, new EffectValueInfo(GetSliderValue(avator.AvatorIndex, EnumVoiceEffect.speed), 0.5m, 4.0m, 0.01m) },
                    { EnumVoiceEffect.pitch, new EffectValueInfo(GetSliderValue(avator.AvatorIndex, EnumVoiceEffect.pitch), 0.5m, 2.0m, 0.01m) },
                    { EnumVoiceEffect.intonation, new EffectValueInfo(GetSliderValue(avator.AvatorIndex, EnumVoiceEffect.intonation), 0.0m, 2.0m, 0.01m) }
                };
                avator.VoiceEffects = new Dictionary <EnumVoiceEffect, EffectValueInfo>
                {
                    { EnumVoiceEffect.volume, new EffectValueInfo(GetSliderValue(avator.AvatorIndex, EnumVoiceEffect.volume), 0.0m, 2.0m, 0.01m) },
                    { EnumVoiceEffect.speed, new EffectValueInfo(GetSliderValue(avator.AvatorIndex, EnumVoiceEffect.speed), 0.5m, 4.0m, 0.01m) },
                    { EnumVoiceEffect.pitch, new EffectValueInfo(GetSliderValue(avator.AvatorIndex, EnumVoiceEffect.pitch), 0.5m, 2.0m, 0.01m) },
                    { EnumVoiceEffect.intonation, new EffectValueInfo(GetSliderValue(avator.AvatorIndex, EnumVoiceEffect.intonation), 0.0m, 2.0m, 0.01m) }
                };
                avator.VoiceEmotions_default = new Dictionary <string, EffectValueInfo>();
                avator.VoiceEmotions         = new Dictionary <string, EffectValueInfo>();
                apply_interface.Add(avator.AvatorName, new Dictionary <string, WPFSlider>());

                talker.effectList.Add("音量");
                talker.VoiceEffects.Add("音量", new EffectValueInfo(GetSliderValue(avator.AvatorIndex, EnumVoiceEffect.volume), 0.0m, 2.0m, 0.01m));
                apply_interface[avator.AvatorName].Add("音量", avator.AvatorUI.VolumeSlider);
                talker.effectList.Add("話速");
                talker.VoiceEffects.Add("話速", new EffectValueInfo(GetSliderValue(avator.AvatorIndex, EnumVoiceEffect.speed), 0.5m, 4.0m, 0.01m));
                apply_interface[avator.AvatorName].Add("話速", avator.AvatorUI.VolumeSlider);
                talker.effectList.Add("高さ");
                talker.VoiceEffects.Add("高さ", new EffectValueInfo(GetSliderValue(avator.AvatorIndex, EnumVoiceEffect.pitch), 0.5m, 2.0m, 0.01m));
                apply_interface[avator.AvatorName].Add("高さ", avator.AvatorUI.VolumeSlider);
                talker.effectList.Add("抑揚");
                talker.VoiceEffects.Add("抑揚", new EffectValueInfo(GetSliderValue(avator.AvatorIndex, EnumVoiceEffect.intonation), 0.0m, 2.0m, 0.01m));
                apply_interface[avator.AvatorName].Add("抑揚", avator.AvatorUI.VolumeSlider);


                // 話者一覧に追加
                //                var talker = new TalkerPrimitive();
                var prefix_str = "VOICEROID+EX ";
                talker.talkerName   = prefix_str + avator.AvatorName;
                talker.originalName = avator.AvatorName;
                talker.typeTalker   = 5;

                log.Text += talker.talkerName;
                log.Text += " ";

                talkerDefaultParamList.Add(talker.originalName, talker);
                talkerlist.Add(talker);
            }

            IsAlive = AvatorParams.Count != 0;
            return(0);
        }