public void SetAudioMainSettings(VoiceType selectedVoiceType, IVoice selectedVoice, bool isPreviewChecked)
        {
            computerVoiceComboBox.ToolTip = NarrationsLabText.SettingsVoiceSelectionInputTooltip;
            previewCheckbox.IsChecked     = isPreviewChecked;
            previewCheckbox.ToolTip       = NarrationsLabText.SettingsPreviewCheckboxTooltip;

            switch (selectedVoiceType)
            {
            case VoiceType.AzureVoice:
                RadioAzureVoice.IsChecked       = true;
                azureVoiceComboBox.SelectedItem = selectedVoice as AzureVoice;
                break;

            case VoiceType.ComputerVoice:
                RadioDefaultVoice.IsChecked        = true;
                computerVoiceComboBox.SelectedItem = selectedVoice as ComputerVoice;
                break;

            case VoiceType.WatsonVoice:
                RadioWatsonVoice.IsChecked       = true;
                watsonVoiceComboBox.SelectedItem = selectedVoice as WatsonVoice;
                break;

            default:
                break;
            }
        }
Esempio n. 2
0
    private void Start()
    {
        textSFXSource = UIManager.Instance.textSFXSource;
        if (speaker)
        {
            voiceType = speaker.voiceType;
        }
        else
        {
            voiceType = VoiceType.Young;
        }

        panelSizedButton.interactable = false;

        nextStep    = true;
        firstStep   = true;
        notFinished = false;

        if (storyScript)
        {
            inkStory = storyScript.inkStory;
        }
        else
        {
            inkStory = new Story(inkFile.text);
        }

        PlayerInfo.WriteToInkStory(inkStory);

        if (inkStory.HasFunction(executeFunction))
        {
            inkStory.CheckInFunction(executeFunction);
        }
    }
Esempio n. 3
0
        /// <summary>
        /// Gets the words from the database.
        /// </summary>
        private void populateBoxes()
        {
            try
            {
                // Create new database context.
                using (MPAiModel DBModel = new MPAiModel())
                {
                    DBModel.Database.Initialize(false); // Added for safety; if the database has not been initialised, initialise it.

                    MPAiUser current = UserManagement.CurrentUser;
                    Console.WriteLine(VoiceType.getDisplayNameFromVoiceType(current.Voice));

                    List <Word> view = DBModel.Word.Where(x => (
                                                              x.Category.Name.Equals("Word") &&
                                                              x.Recordings.Any(y => y.Speaker.SpeakerId == current.Speaker.SpeakerId)
                                                              )).ToList();

                    view.Sort(new VowelComparer());
                    WordComboBox.DataSource = new BindingSource()
                    {
                        DataSource = view
                    };
                    WordComboBox.DisplayMember = "Name";
                }
            }
            catch (Exception exp)
            {
                Console.WriteLine(exp);
            }
        }
Esempio n. 4
0
        private static void OnSettingsDialogConfirmed(VoiceType selectedVoiceType, IVoice selectedVoice, bool isPreviewCurrentSlide)
        {
            IsPreviewEnabled = isPreviewCurrentSlide;

            AudioSettingService.selectedVoiceType = selectedVoiceType;
            AudioSettingService.selectedVoice     = selectedVoice;
        }
Esempio n. 5
0
        /// <summary>
        /// Plays or pauses the audio, depending on the VLC player's current state.
        /// </summary>
        private void playAudio()
        {
            using (MPAiModel DBModel = MPAiModel.InitializeDBModel())
            {
                Word    wd  = wordsList[currentRecordingIndex];
                Speaker spk = UserManagement.CurrentUser.Speaker;  // Get the speaker from user settings.
                Console.WriteLine(UserManagement.CurrentUser.Speaker.Name + " " + VoiceType.getDisplayNameFromVoiceType(UserManagement.CurrentUser.Voice));
                Recording rd = DBModel.Recording.Local.Where(x => x.WordId == wd.WordId && x.SpeakerId == spk.SpeakerId).SingleOrDefault();

                if (rd != null)
                {
                    ICollection <SingleFile> audios = rd.Audios;
                    if (audios == null || audios.Count == 0)
                    {
                        throw new Exception("No audio recording!");
                    }
                    SingleFile sf = audios.PickNext();
                    filePath = Path.Combine(sf.Address, sf.Name);

                    asyncPlay();
                    playButton.ImageIndex = 3;
                }
                else
                {
                    MPAiMessageBoxFactory.Show(invalidRecordingString);
                }
            }
        }
Esempio n. 6
0
 public TextEvent(string message)
 {
     this.message = message;
     speed = 100;
     voice = VoiceType.claire22s;
     pitch = 100;
 }
Esempio n. 7
0
 public TextEvent(string message, VoiceType voice, int speed)
 {
     this.message = message;
     this.voice = voice;
     this.speed = speed;
     pitch = 100;
 }
Esempio n. 8
0
        /// <summary>
        /// Checks the approrpiate checked controls based on the current user's voice settings.
        /// </summary>
        private void checkAppropriateComponents()
        {
            VoiceType voiceType = UserManagement.CurrentUser.Voice;

            if (voiceType.Gender.Equals(GenderType.MASCULINE) && voiceType.Language.Equals(LanguageType.NATIVE))
            {
                nativeMāoriToolStripMenuItem.Checked = true;
                masculineToolStripMenuItem.Checked   = true;
            }
            else if (voiceType.Gender.Equals(GenderType.FEMININE) && voiceType.Language.Equals(LanguageType.NATIVE))
            {
                nativeMāoriToolStripMenuItem.Checked = true;
                feminineToolStripMenuItem.Checked    = true;
            }
            else if (voiceType.Gender.Equals(GenderType.MASCULINE) && voiceType.Language.Equals(LanguageType.MODERN))
            {
                modernMāoriToolStripMenuItem.Checked = true;
                masculineToolStripMenuItem.Checked   = true;
            }
            else if (voiceType.Gender.Equals(GenderType.FEMININE) && voiceType.Language.Equals(LanguageType.MODERN))
            {
                modernMāoriToolStripMenuItem.Checked = true;
                feminineToolStripMenuItem.Checked    = true;
            }
        }
        public void SetAudioPreviewSettings(string textToSpeak, VoiceType selectedVoiceType, IVoice selectedVoice)
        {
            spokenText.Text = textToSpeak;
            if (selectedVoiceType == VoiceType.DefaultVoice)
            {
                defaultVoiceRadioButton.IsChecked = true;
                return;
            }
            if (rankedAudioListView.Items.Contains(selectedVoice))
            {
                rankedAudioListView.SelectedItem = selectedVoice;
                return;
            }
            switch (selectedVoiceType)
            {
            case VoiceType.AzureVoice:
                azureVoiceRadioButton.IsChecked = true;
                azureVoiceComboBox.SelectedItem = selectedVoice as AzureVoice;
                break;

            case VoiceType.ComputerVoice:
                computerVoiceRadioButton.IsChecked = true;
                computerVoiceComboBox.SelectedItem = selectedVoice as ComputerVoice;
                break;

            case VoiceType.WatsonVoice:
                watsonVoiceRadioButton.IsChecked = true;
                watsonVoiceComboBox.SelectedItem = selectedVoice as WatsonVoice;
                break;

            default:
                defaultVoiceRadioButton.IsChecked = true;
                break;
            }
        }
Esempio n. 10
0
 public TextEvent(string message, VoiceType voice, int speed, int pitch)
 {
     this.message = message;
     this.voice = voice;
     this.speed = speed;
     this.pitch = pitch;
 }
Esempio n. 11
0
        public static string Getsuffix(VoiceType type)
        {
            var suffix = ".mp3";

            switch (type)
            {
            case VoiceType.mp3:
                suffix = ".mp3";
                break;

            case VoiceType.pcm:
                suffix = ".pcm";
                break;

            case VoiceType.wav:
                suffix = ".wav";
                break;

            case VoiceType.amr:
                suffix = ".wav";
                break;

            default:
                suffix = ".mp3";
                break;
            }
            return(suffix);
        }
        public static VoiceType FromFlightPlanRemarks(this VoiceType vt, string remarks)
        {
            bool      flag = remarks.ToLower().Contains("/v/");
            VoiceType result;

            if (flag)
            {
                result = VoiceType.Full;
            }
            else
            {
                bool flag2 = remarks.ToLower().Contains("/r/");
                if (flag2)
                {
                    result = VoiceType.ReceiveOnly;
                }
                else
                {
                    bool flag3 = remarks.ToLower().Contains("/t/");
                    if (flag3)
                    {
                        result = VoiceType.TextOnly;
                    }
                    else
                    {
                        result = VoiceType.Unknown;
                    }
                }
            }
            return(result);
        }
        public static VoiceType FromString(this VoiceType vt, string typeID)
        {
            string    a = typeID.ToLower();
            VoiceType result;

            switch (a)
            {
            case "t":
                result = VoiceType.TextOnly;
                break;

            case "r":
                result = VoiceType.ReceiveOnly;
                break;

            case "v":
                result = VoiceType.Full;
                break;

            default:
                result = VoiceType.Unknown;
                break;
            }
            return(result);
        }
Esempio n. 14
0
    public static void PlayVoice(VoiceType voiceType, Language language)
    {
        if (Time.time - LastPlayVoiceTime < 1)
        {
            return;
        }
        LastPlayVoiceTime = Time.time;

        switch (voiceType)
        {
        case VoiceType.Armor_Not_Pierced:
            PoolManager.CreateObject(RandomStringInList(Self.Armor_Not_Pierced) + language.ToString(), Vector3.zero, Vector3.zero);
            break;

        case VoiceType.Armor_Pierced:
            PoolManager.CreateObject(RandomStringInList(Self.Armor_Pierced) + language.ToString(), Vector3.zero, Vector3.zero);
            break;

        case VoiceType.Armor_Ricochet:
            PoolManager.CreateObject(RandomStringInList(Self.Armor_Ricochet) + language.ToString(), Vector3.zero, Vector3.zero);
            break;

        case VoiceType.Enemy_Killed:
            PoolManager.CreateObject(RandomStringInList(Self.Enemy_Killed) + language.ToString(), Vector3.zero, Vector3.zero);
            break;

        case VoiceType.Start_Battle:
            PoolManager.CreateObject(RandomStringInList(Self.Start_Battle) + language.ToString(), Vector3.zero, Vector3.zero);
            break;

        case VoiceType.Vehicle_Destroyed:
            PoolManager.CreateObject(RandomStringInList(Self.Vehicle_Destroyed) + language.ToString(), Vector3.zero, Vector3.zero);
            break;
        }
    }
Esempio n. 15
0
        public async Task Play(VoiceType response, int volume)
        {
            await _lock.WaitAsync();

            var localFilePath = Path.Combine(Directories.VoiceDir, $"{response.ToString()}.mp3");

            if (!_mp3Times.ContainsKey(response))
            {
                using (var mp3File = new Mp3FileReader(Path.Combine(Directories.VoiceDir, $"{response.ToString()}.mp3")))
                {
                    _mp3Times.Add(response, mp3File.TotalTime);
                }
            }

            using (var mainOutputStream = new Mp3FileReader(Path.GetFullPath(localFilePath)))
                using (var volumeStream = new WaveChannel32(mainOutputStream))
                    using (var waveOut = new WaveOutEvent {
                        DeviceNumber = -1, Volume = (float)volume / 100
                    })
                    {
                        waveOut.Init(volumeStream);
                        waveOut.Play();

                        await Task.Delay(_mp3Times[response]);
                    }

            _lock.Release();
        }
Esempio n. 16
0
 public void Play(VoiceType type)
 {
     _type = type;
     SeletePath(type);
     player.SoundLocation = filePath.OriginalString;
     player.Load();
     player.Play();
 }
Esempio n. 17
0
 public List <ExcelTableEntity> GetVoiceForType(VoiceType type)
 {
     if (dic.ContainsKey((int)type))
     {
         return(dic[(int)type]);
     }
     return(null);
 }
Esempio n. 18
0
 protected override void RefreshAudioVolume(VoiceType voiceType, float vol)
 {
     if (this.s_VoiceType == voiceType)
     {
         m_MaxVolume = vol * s_Vol;
     }
     base.RefreshAudioVolume(voiceType, vol);
 }
Esempio n. 19
0
        static void Main(string[] args)
        {
            Console.WriteLine(VoiceType.getStringFromVoiceType(new VoiceType(GenderType.MASCULINE, LanguageType.MODERN)));

            Application.Run(new LoginScreen());

            Application.Exit();
        }
Esempio n. 20
0
 private void AddAudioSource(PlayerType pt, VoiceType vt, AudioClip ac)
 {
     if (CommonFunction.IsNull(ac) == false)
     {
         AudioSource a = gameObject.AddComponent <AudioSource>();
         a.clip = ac;
         VoicesList[pt].Add(vt, a);
     }
 }
Esempio n. 21
0
 public TextToSpeechParameters(VoiceType voiceType, OutputFormatParameterValues outputFormat,
                               Locale locale, string requestUri, string authToken, string text)
 {
     _voiceType    = voiceType;
     _outputFormat = outputFormat;
     _locale       = EnumToHyphenString(locale);
     _requestUri   = requestUri;
     _authToken    = authToken;
     _text         = text;
 }
Esempio n. 22
0
        private void formantButton_Click(object sender, EventArgs e)
        {
            MPAiUser user = UserManagement.CurrentUser;

            PlotController.PlotType?plotType = PlotController.PlotType.FORMANT_PLOT;
            VoiceType voiceType = user.Voice;

            PlotController.RunPlot(plotType, voiceType);

            closeThis();
        }
Esempio n. 23
0
 /// <summary>
 /// TO DO: Return languages for wavenet instead of voice names
 /// </summary>
 /// <param name="type"></param>
 /// <returns></returns>
 private string[] GetLanguagesByType(VoiceType type)
 {
     if (type == GoogleCloud.VoiceType.WaveNet)
     {
         return(System.Enum.GetNames(typeof(GoogleCloud.WaveNetVoice)).Where(enumString => enumString.Contains("Wavenet")).ToArray());
     }
     else
     {
         return(System.Enum.GetNames(typeof(GoogleCloud.Language)));
     }
 }
Esempio n. 24
0
        private void OnVoiceSelect(Data data)
        {
            VoiceData voice = data as VoiceData;

            if (voice == null)
            {
                throw new WatsonException("Unexpected data type");
            }

            m_Voice = voice.Voice;
        }
Esempio n. 25
0
    // This is only called when the scene loads.
    void Start()
    {
        vision = GameObject.FindGameObjectWithTag("Webcam").GetComponent <WebCamTextureToCloudVision> ();

        curr_voice = VoiceType.fr_FR_Renee;

        // Strictly for debugging to test a few words!
        if (isDebug)
        {
            StartCoroutine(Process("en", "Bonsoir."));
        }
    }
Esempio n. 26
0
 private void PlaySound(VoiceType response)
 {
     if (!_voiceEnabled)
     {
         return;
     }
     if (!_isReady)
     {
         return;
     }
     _ = Task.Run(async() => await _voice.Play(response, _soundVolume));
 }
Esempio n. 27
0
    /// <summary>
    /// 修改声音类型
    /// </summary>
    private void SetVoiceSetting(VoiceType type)
    {
        switch (type)
        {
        case VoiceType.Is2D:
            Set2DVoiceSetting();
            break;

        case VoiceType.Is3D:
            Set3DVoiceSetting();
            break;
        }
    }
Esempio n. 28
0
        private void checkAndSetNativeDisplayVoice()
        {
            VoiceType voiceType = UserManagement.CurrentUser.Voice;

            if (voiceType.Gender.Equals(GenderType.FEMININE))
            {
                nativeMāoriToolStripMenuItem.Text = DisplayVoice.DisplayNative(GenderType.FEMININE);
            }
            else
            {
                nativeMāoriToolStripMenuItem.Text = DisplayVoice.DisplayNative(GenderType.MASCULINE);
            }
        }
Esempio n. 29
0
        /// <summary>
        /// 设置音量
        /// </summary>
        /// <param name="voiceType">音效类型</param>
        /// <param name="value"></param>
        public void SetMusicGameVolume(VoiceType voiceType, float value)
        {
            switch (voiceType)
            {
            case VoiceType.Music:
                GlobalData.MusicGameVolume = value;
                break;

            case VoiceType.Sound:
                GlobalData.SoundGameVolume = value;
                break;
            }
            MsgDispatcher.SendMessage(GlobalEventType.GlobalVolumeChange, voiceType, value);
        }
        private void ConfigureAudioPreviewSettings(AudioPreviewPage page)
        {
            string textToSpeak = captionTextBox.Text.Trim();
            string voiceName   = StringUtility.ExtractVoiceNameFromVoiceLabel(audioNameLabel.Text.ToString());

            if (!AudioService.CheckIfVoiceExists(voiceName))
            {
                page.SetAudioPreviewSettings(textToSpeak, VoiceType.DefaultVoice, AudioSettingService.selectedVoice);
                return;
            }
            string    defaultPostfix = StringUtility.ExtractDefaultLabelFromVoiceLabel(audioNameLabel.Text.ToString());
            VoiceType voiceType      = AudioService.GetVoiceTypeFromString(voiceName, defaultPostfix);
            IVoice    voice          = AudioService.GetVoiceFromString(voiceName);

            page.SetAudioPreviewSettings(textToSpeak, voiceType, voice);
        }
Esempio n. 31
0
        protected override void RefreshAudioVolume(VoiceType voiceType, float vol)
        {
#if !UNITY_EDITOR && UNITY_ANDROID//
            float onceVolume = vol * s_Vol;
            if (m_AndroidPluginsSoundId != 0)
            {
                DBTSDK.SDKToolManager.Instance.SetEffectsVolume(onceVolume);
            }
            //AndroidNativeAudio.setVolume(m_AndroidPluginsSoundId, onceVolume, onceVolume);
            else
            {
                base.RefreshAudioVolume(voiceType, vol);
            }
#else
            base.RefreshAudioVolume(voiceType, vol);
#endif
        }
Esempio n. 32
0
 public void OnTtsStart()
 {
     if (!isFocus)
     {
         return;
     }
     LogUtils.Log("OnTtsStart");
     currentVoiceType = VoiceType.TTS;
     resultText.gameObject.SetActive(false);
     stopBtnObj.SetActive(false);
     audioEffectObj.SetActive(false);
     startEffectObj.SetActive(false);
     speakEffect.gameObject.SetActive(false);
     voiceImage.color  = Color.white;
     voiceBtn.enabled  = true;
     voiceAnim.enabled = true;
     ttsEffectObj.SetActive(true);
 }
Esempio n. 33
0
 /// <summary>
 /// Default constructor. Where possible, fills the user's details into the text boxes.
 /// </summary>
 public RenameFileDialog()
 {
     InitializeComponent();
     // Use user settings or menu data to automatically fill the fields.
     // Speaker = user's screen name
     speakerComboBox.Items.AddRange(new object[4] {
         VoiceType.getDisplayNameFromVoiceType(new VoiceType(GenderType.FEMININE, LanguageType.NATIVE)),
         VoiceType.getDisplayNameFromVoiceType(new VoiceType(GenderType.MASCULINE, LanguageType.NATIVE)),
         VoiceType.getDisplayNameFromVoiceType(new VoiceType(GenderType.FEMININE, LanguageType.MODERN)),
         VoiceType.getDisplayNameFromVoiceType(new VoiceType(GenderType.MASCULINE, LanguageType.MODERN))
     });
     speakerComboBox.SelectedItem = VoiceType.getDisplayNameFromVoiceType(UserManagement.CurrentUser.Voice);
     // Category has a drop down list for scalability, although in this version it's just Word and Vowel.
     populateCategoryComboBox();
     // Word will need a drop-down list
     populateWordComboBox();
     // Label should start with focus and be up to them.
 }
Esempio n. 34
0
 /// <summary>
 /// 棒読みちゃんに音声合成タスクを追加します。
 /// </summary>
 /// <param name="sTalkText">喋らせたい文章</param>
 /// <param name="iSpeed"   >速度。(-1で棒読みちゃん側の画面で選んでいる速度)</param>
 /// <param name="iTone"    >音程。(-1で棒読みちゃん側の画面で選んでいる音程)</param>
 /// <param name="iVolume"  >音量。(-1で棒読みちゃん側の画面で選んでいる音量)</param>
 /// <param name="vType"    >声の種類。(Defaultで棒読みちゃん側の画面で選んでいる声)</param>
 public void AddTalkTask(string sTalkText, int iSpeed, int iTone, int iVolume, VoiceType vType)
 {
     RemotingObject.AddTalkTask(sTalkText, iSpeed, iTone, iVolume, (int)vType);
 }
Esempio n. 35
0
 public TextEvent(string message, VoiceType voice)
 {
     this.message = message;
     this.voice = voice;
     speed = 100;
 }
Esempio n. 36
0
 /// <summary>
 /// 棒読みちゃんに音声合成タスクを追加します。読み上げタスクIDを返します。
 /// </summary>
 /// <param name="sTalkText">喋らせたい文章</param>
 /// <param name="iSpeed"   >速度。(-1で棒読みちゃん側の画面で選んでいる速度)</param>
 /// <param name="iTone"    >音程。(-1で棒読みちゃん側の画面で選んでいる音程)</param>
 /// <param name="iVolume"  >音量。(-1で棒読みちゃん側の画面で選んでいる音量)</param>
 /// <param name="vType"    >声の種類。(Defaultで棒読みちゃん側の画面で選んでいる声)</param>
 /// <returns>読み上げタスクID。</returns>
 public int AddTalkTask2(string sTalkText, int iSpeed, int iTone, int iVolume, VoiceType vType)
 {
     return RemotingObject.AddTalkTask2(sTalkText, iSpeed, iTone, iVolume, (int)vType);
 }