• 大小: 534KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-05-25
  • 语言: 其他
  • 标签: unity  

资源简介

本程序实现了在unity中调用微软语音合成,压缩包是工程压缩包,里面有涉及的所有源代码!

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Speech.Synthesis;
using Speech.Properties;

namespace Speech
{
    class Program
    {
        static void Main(string[] args)
        {
            /*
            var speaker = new SpeechSynthesizer();//SpeechSynthesizer:语音合成器
            speaker.Speak(“凡妙然“);
            */
            /*
            var speaker = new SpeechSynthesizer();
            var res = args.Length == 0 ? “请说“ : args[0];
            speaker.Speak(res);
             */
            var speaker = new SpeechSynthesizer();
            speaker.Volume = Settings.Default.SpeakVolume;
            speaker.Rate = Settings.Default.SpeakRate;
            var voice = Settings.Default.SpeakVoice;
            if (!string.IsNullOrEmpty(voice))
                speaker.SelectVoice(voice);
            var res = args.Length == 0 ? “锄禾日当午,汗滴禾下土“ : args[0];
            speaker.Speak(res);
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2016-09-20 12:53  unitySAPIYuYnHeCheng20160924\
     目录           0  2016-09-20 12:32  unitySAPIYuYnHeCheng20160924\SPAI语音合成\
     目录           0  2016-09-20 12:32  unitySAPIYuYnHeCheng20160924\SPAI语音合成\.vs\
     目录           0  2016-09-20 12:32  unitySAPIYuYnHeCheng20160924\SPAI语音合成\.vs\SPAI语音合成\
     目录           0  2016-09-20 12:32  unitySAPIYuYnHeCheng20160924\SPAI语音合成\.vs\SPAI语音合成\v14\
     文件       37888  2016-09-20 12:53  unitySAPIYuYnHeCheng20160924\SPAI语音合成\.vs\SPAI语音合成\v14\.suo
     文件         860  2016-07-26 10:49  unitySAPIYuYnHeCheng20160924\SPAI语音合成\SPAI语音合成.sln
     文件       16896  2016-07-26 15:53  unitySAPIYuYnHeCheng20160924\SPAI语音合成\SPAI语音合成.suo
     目录           0  2016-09-20 12:32  unitySAPIYuYnHeCheng20160924\SPAI语音合成\Speech\
     文件        1051  2016-07-26 10:51  unitySAPIYuYnHeCheng20160924\SPAI语音合成\Speech\Program.cs
     目录           0  2016-09-20 12:32  unitySAPIYuYnHeCheng20160924\SPAI语音合成\Speech\Properties\
     文件        1344  2016-07-26 10:35  unitySAPIYuYnHeCheng20160924\SPAI语音合成\Speech\Properties\AssemblyInfo.cs
     文件        2752  2016-07-26 10:49  unitySAPIYuYnHeCheng20160924\SPAI语音合成\Speech\Properties\Settings.Designer.cs
     文件         767  2016-07-26 10:49  unitySAPIYuYnHeCheng20160924\SPAI语音合成\Speech\Properties\Settings.settings
     文件        2654  2016-07-26 10:50  unitySAPIYuYnHeCheng20160924\SPAI语音合成\Speech\Speech.csproj
     文件          77  2016-07-26 10:45  unitySAPIYuYnHeCheng20160924\SPAI语音合成\Speech\app.config
     目录           0  2016-09-20 12:32  unitySAPIYuYnHeCheng20160924\SPAI语音合成\Speech\bin\
     目录           0  2016-09-20 12:32  unitySAPIYuYnHeCheng20160924\SPAI语音合成\Speech\bin\Debug\
     文件        6656  2016-07-26 10:51  unitySAPIYuYnHeCheng20160924\SPAI语音合成\Speech\bin\Debug\Speech.exe
     文件          77  2016-07-26 10:45  unitySAPIYuYnHeCheng20160924\SPAI语音合成\Speech\bin\Debug\Speech.exe.config
     文件       17920  2016-07-26 10:51  unitySAPIYuYnHeCheng20160924\SPAI语音合成\Speech\bin\Debug\Speech.pdb
     文件       22696  2016-09-20 12:53  unitySAPIYuYnHeCheng20160924\SPAI语音合成\Speech\bin\Debug\Speech.vshost.exe
     文件          77  2016-07-26 10:45  unitySAPIYuYnHeCheng20160924\SPAI语音合成\Speech\bin\Debug\Speech.vshost.exe.config
     文件         490  2013-06-18 20:28  unitySAPIYuYnHeCheng20160924\SPAI语音合成\Speech\bin\Debug\Speech.vshost.exe.manifest
     目录           0  2016-09-24 21:10  unitySAPIYuYnHeCheng20160924\SPAI语音合成\Speech\bin\Release\
     目录           0  2016-09-20 12:32  unitySAPIYuYnHeCheng20160924\SPAI语音合成\Speech\obj\
     目录           0  2016-09-20 12:32  unitySAPIYuYnHeCheng20160924\SPAI语音合成\Speech\obj\x86\
     目录           0  2016-09-20 12:32  unitySAPIYuYnHeCheng20160924\SPAI语音合成\Speech\obj\x86\Debug\
     文件        6896  2016-09-20 12:33  unitySAPIYuYnHeCheng20160924\SPAI语音合成\Speech\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
     文件         897  2016-09-20 12:53  unitySAPIYuYnHeCheng20160924\SPAI语音合成\Speech\obj\x86\Debug\Speech.csproj.FileListAbsolute.txt
     文件        6656  2016-07-26 10:51  unitySAPIYuYnHeCheng20160924\SPAI语音合成\Speech\obj\x86\Debug\Speech.exe
............此处省略376个文件信息

评论

共有 条评论