資源簡介
一個簡單的c#調用訊飛在線語音demo,代碼注釋寫的清楚,一看就懂.

代碼片段和文件信息
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?TTS;
using?System.IO;
using?System.Runtime.InteropServices;
using?System.Media;
using?System.Threading;
namespace?pstoh_timer
{
????public?partial?class?Form1?:?Form
????{
????????private?int?hour;
????????private?int?minute;
????????private?int?month;
????????private?int?weekIndex;
????????private?int?day;
????????string[]?dayOfWeek?=?new?string[]?{?“星期日“?“星期一“?“星期二“?“星期三“?“星期四“?“星期五“?“星期六“?};
????????private?int?year;
????????public?Form1()
????????{
????????????InitializeComponent();
????????}
????????public?int?second?{?get;?private?set;?}
????????private?void?Form1_Load(object?sender?EventArgs?e)
????????{
????????????//TTSUtils.Speak(“舍棄不是浪費.?當不乏因行囊而蹣跚舍掉偌重的負荷腳步會更堅實.?甚至舍棄比擁有更需要勇氣擁有是我們曾經的汗水心愛的珍寶棄之幾許依依之情絲痛心啊!“);
????????????//給下拉框設置默認索引
????????????try
????????????{
????????????????SpeakMaginCob.SelectedIndex?=?int.Parse(File.ReadAllText(“app.config“?Encoding.Default));
????????????}catch
????????????{
????????????????SpeakMaginCob.SelectedIndex?=?0;
????????????}
????????}
????????private?void?timer1_Tick(object?sender?EventArgs?e)
????????{
????????????//獲取年月日
?????????????year?=?DateTime.Now.Year;
????????????month=DateTime.Now.Month?;
????????????day?=?DateTime.Now.Day;
????????????//獲取星期
????????????weekIndex=int.Parse(?DateTime.Now.DayOfWeek.ToString(“d“));
????????????//老外把星期日算作0因此需判斷下
????????????//if?(weekIndex?==?0)
????????????//{
??????????????//??weekIndex?=?7;
????????????//}
????????????hour=DateTime.Now.Hour;
????????????minute=DateTime.Now.Minute;
????????????second=DateTime.Now.Second;
????????????String?speakTime?=?null;
????????????switch?(SpeakMaginCob.SelectedIndex)
????????????{
????????????????case?0:
????????????????????//每小時報時一次
????????????????????if?(minute?==?0?&&?second?==?0)
????????????????????{
????????????????????????speakTime?=?“現在是“?+?year?+?“年“?+?month?+?“月“?+?day?+?“日“?+dayOfWeek[weekIndex].ToString()+“?“?+?hour?+?“點整“;
????????????????????????//報時
????????????????????????TTSUtils.Speak(speakTime);
????????????????????}
????????????????????break;
????????????????case?1:
????????????????????//半小時報時一次
????????????????????if?(minute?==?0?&&?second?==?0)
????????????????????{
????????????????????????speakTime?=?“現在是“?+?year?+?“年“?+?month?+?“月“?+?day?+?“日“?+?dayOfWeek[weekIndex].ToString()?+?“?“?+?hour?+?“點整“;
????????????????????????//報時
????????????????????????TTSUtils.Speak(speakTime);
????????????????????}else?if?(minute?==?30?&&?second?==?0)
????????????????????{
????????????????????????speakTime?=?“現在是“?+?hour?+?“點“?+?minute?+?“分!“;
????????????????????????TTSUtils.Speak(speakTime);
????????????????????}
????????????????????break;
????????????????case?2:
????????????????????//每克中報時一次
????????????????????if?(
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????????53??2017-06-11?14:49??pstoh時鐘\.git\COMMIT_EDITMSG
?????文件????????189??2017-06-10?15:40??pstoh時鐘\.git\config
?????文件?????????73??2017-06-10?13:46??pstoh時鐘\.git\desc
?????文件??????????0??2017-06-11?08:48??pstoh時鐘\.git\FETCH_HEAD
?????文件?????????48??2017-06-10?16:31??pstoh時鐘\.git\GITGUI_MSG
?????文件????????132??2017-06-10?15:51??pstoh時鐘\.git\gitk.cache
?????文件?????????23??2017-06-10?13:46??pstoh時鐘\.git\HEAD
?????文件????????452??2017-06-10?13:46??pstoh時鐘\.git\hooks\applypatch-msg.sample
?????文件????????896??2017-06-10?13:46??pstoh時鐘\.git\hooks\commit-msg.sample
?????文件????????189??2017-06-10?13:46??pstoh時鐘\.git\hooks\post-update.sample
?????文件????????398??2017-06-10?13:46??pstoh時鐘\.git\hooks\pre-applypatch.sample
?????文件???????1642??2017-06-10?13:46??pstoh時鐘\.git\hooks\pre-commit.sample
?????文件???????1352??2017-06-10?13:46??pstoh時鐘\.git\hooks\pre-push.sample
?????文件???????4951??2017-06-10?13:46??pstoh時鐘\.git\hooks\pre-reba
?????文件???????1239??2017-06-10?13:46??pstoh時鐘\.git\hooks\prepare-commit-msg.sample
?????文件???????3611??2017-06-10?13:46??pstoh時鐘\.git\hooks\update.sample
?????文件????????614??2017-06-11?14:46??pstoh時鐘\.git\index
?????文件????????251??2017-06-10?14:39??pstoh時鐘\.git\info\exclude
?????文件????????711??2017-06-11?14:49??pstoh時鐘\.git\logs\HEAD
?????文件????????711??2017-06-11?14:49??pstoh時鐘\.git\logs\refs\heads\master
?????文件???????2438??2017-06-10?14:46??pstoh時鐘\.git\ob
?????文件???????1383??2017-06-11?09:03??pstoh時鐘\.git\ob
?????文件????????966??2017-06-10?14:46??pstoh時鐘\.git\ob
?????文件???????1665??2017-06-10?14:46??pstoh時鐘\.git\ob
?????文件???????1323??2017-06-10?15:41??pstoh時鐘\.git\ob
?????文件????????865??2017-06-10?15:41??pstoh時鐘\.git\ob
?????文件????????511??2017-06-11?14:46??pstoh時鐘\.git\ob
?????文件????????265??2017-06-10?15:43??pstoh時鐘\.git\ob
?????文件????????254??2017-06-11?09:03??pstoh時鐘\.git\ob
?????文件???????1097??2017-06-10?15:41??pstoh時鐘\.git\ob
............此處省略136個文件信息
評論
共有 條評論