Exemplo n.º 1
0
 public void SetSpeaker(Speeker speeker)
 {
     if (DSpeeker.ContainsKey(speeker))
     {
         _speeker = DSpeeker[speeker];
     }
 }
Exemplo n.º 2
0
        public void SpeekerTest()
        {
            ManualResetEvent m = new ManualResetEvent(false);

            new Thread(() => { Application.Run(new Form()); m.Set(); }).Start();

            for (int i = 0; i < 100; i++)
            {
                Speeker.SpeakAsynchSf("test " + i);
            }

            m.WaitOne();
        }
Exemplo n.º 3
0
        public float Multi_Speak(string SpeekText, Speeker speeker)
        {
            SetSpeaker(speeker);
            MemoryStream memoryStream = m_XunFeiTemplate.SpeechSynthesis(SpeekText);
            AudioClip    audioClip    = ToAudioClip(memoryStream.ToArray());

            if (audioClip == null)
            {
                return(-1);
            }
            m_AudioSource.Stop();
            m_AudioSource.PlayOneShot(audioClip);
            return(audioClip.length);
        }
Exemplo n.º 4
0
 /// <summary>
 /// 设置发音人
 /// </summary>
 /// <param name="speeker"></param>
 public void SetSpeaker(Speeker speeker)
 {
     m_XunFeiTemplate.SetSpeaker(speeker);
 }