• 大小: 154KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-11
  • 语言: 其他
  • 标签: TTS发音  

资源简介

TTS发音 微软自带的TTS发音程序示例

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using SpeechLib;
using System.Speech.Synthesis;

namespace TestVoice
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            //Test();
        }

        private void Test()
        {
            try
            {
                SpeechVoiceSpeakFlags spFlags = SpeechVoiceSpeakFlags.SVSFlagsAsync;
                SpVoiceClass voice = new SpVoiceClass();
                voice.Voice = voice.GetVoices(string.Empty string.Empty).Item(2);
                voice.Speak(textBox1.Text spFlags);
            }
            catch (Exception error)
            {
 
            }
        }

        private void Test2()
        {
            SpeechSynthesizer talker = new SpeechSynthesizer();
            talker.Rate = -2;
            talker.Volume = 100;
            talker.SelectVoiceByHints(VoiceGender.Female VoiceAge.Senior 2 System.Globalization.CultureInfo.CurrentCulture);
            talker.SpeakAsync(textBox1.Text);
        }

        private void button1_Click(object sender EventArgs e)
        {
            Test();
        }

        private void button2_Click(object sender EventArgs e)
        {
            Test2();
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件     163840  2010-10-11 09:48  TestVoice\TestVoice\bin\Debug\DotNetSpeech.dll

     文件     163840  2010-10-11 10:24  TestVoice\TestVoice\bin\Debug\Interop.SpeechLib.dll

     文件       9216  2010-10-11 10:32  TestVoice\TestVoice\bin\Debug\TestVoice.exe

     文件      24064  2010-10-11 10:32  TestVoice\TestVoice\bin\Debug\TestVoice.pdb

     文件      14328  2010-10-11 10:33  TestVoice\TestVoice\bin\Debug\TestVoice.vshost.exe

     文件        490  2007-07-21 01:33  TestVoice\TestVoice\bin\Debug\TestVoice.vshost.exe.manifest

     文件       1463  2010-10-11 10:45  TestVoice\TestVoice\Form1.cs

     文件       3138  2010-10-11 10:29  TestVoice\TestVoice\Form1.Designer.cs

     文件       5814  2010-10-11 10:29  TestVoice\TestVoice\Form1.resx

     文件     163840  2010-10-11 10:24  TestVoice\TestVoice\obj\Debug\Interop.SpeechLib.dll

     文件       2509  2010-10-11 09:50  TestVoice\TestVoice\obj\Debug\ResolveAssemblyReference.cache

     文件        754  2010-10-11 10:33  TestVoice\TestVoice\obj\Debug\TestVoice.csproj.FileListAbsolute.txt

     文件        847  2010-10-11 10:29  TestVoice\TestVoice\obj\Debug\TestVoice.csproj.GenerateResource.Cache

     文件        579  2010-10-11 10:24  TestVoice\TestVoice\obj\Debug\TestVoice.csproj.ResolveComReference.cache

     文件       9216  2010-10-11 10:32  TestVoice\TestVoice\obj\Debug\TestVoice.exe

     文件        180  2010-10-11 10:29  TestVoice\TestVoice\obj\Debug\TestVoice.Form1.resources

     文件      24064  2010-10-11 10:32  TestVoice\TestVoice\obj\Debug\TestVoice.pdb

     文件        180  2010-10-11 10:29  TestVoice\TestVoice\obj\Debug\TestVoice.Properties.Resources.resources

     文件        490  2010-10-11 09:44  TestVoice\TestVoice\Program.cs

     文件       1360  2010-10-11 09:44  TestVoice\TestVoice\Properties\AssemblyInfo.cs

     文件       2868  2010-10-11 09:44  TestVoice\TestVoice\Properties\Resources.Designer.cs

     文件       5612  2010-10-11 09:44  TestVoice\TestVoice\Properties\Resources.resx

     文件       1094  2010-10-11 09:44  TestVoice\TestVoice\Properties\Settings.Designer.cs

     文件        249  2010-10-11 09:44  TestVoice\TestVoice\Properties\Settings.settings

     文件       4278  2010-10-11 10:29  TestVoice\TestVoice\TestVoice.csproj

     文件        917  2010-10-11 09:44  TestVoice\TestVoice.sln

    ..A..H.     14336  2010-10-11 10:45  TestVoice\TestVoice.suo

     目录          0  2010-10-11 09:44  TestVoice\TestVoice\obj\Debug\TempPE

     目录          0  2010-10-11 10:24  TestVoice\TestVoice\bin\Debug

     目录          0  2010-10-11 10:32  TestVoice\TestVoice\obj\Debug

............此处省略8个文件信息

评论

共有 条评论

相关资源