資源簡介
C#語音播放+語音生成工具Winform,吐血推薦,使用與移動終端自助機的 語音播放,絕對可以用的, VS2008環境。

代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.Linq;
using?System.Text;
using?System.Runtime.InteropServices;???
namespace?FD.Common
{
????public?class?SoundPlay
????{
????????protected?const?int?SND_SYNC?=?0x0;
????????protected?const?int?SND_ASYNC?=?0x1;
????????protected?const?int?SND_NODEFAULT?=?0x2;
????????protected?const?int?SND_MEMORY?=?0x4;
????????protected?const?int?SND_LOOP?=?0x8;
????????protected?const?int?SND_NOSTOP?=?0x10;
????????protected?const?int?SND_NOWAIT?=?0x2000;
????????protected?const?int?SND_ALIAS?=?0x10000;
????????protected?const?int?SND_ALIAS_ID?=?0x110000;
????????protected?const?int?SND_FILENAME?=?0x20000;
????????protected?const?int?SND_RESOURCE?=?0x40004;
????????protected?const?int?SND_PURGE?=?0x40;
????????protected?const?int?SND_APPLICATION?=?0x80;
????????[DllImport(“Winmm.dll“?CharSet?=?CharSet.Auto?EntryPoint?=?“PlaySound“)]
????????protected?extern?static?bool?PlaySound(string?strFile?IntPtr?hMod?int?flag);
????????///?
????????///?播放聲音函數
????????///?
????????///?聲音文件
????????///?是否同步,如果為True,則播放聲音完畢再執行后面的操作,為False,則播放聲音的同時繼續執行后面的操作
????????///?
????????public?static?bool?PlaySoundFile(string?strSoundFile?bool?bSynch)
????????{
????????????if?(!System.IO.File.Exists(strSoundFile))
????????????????return?false;
????????????int?Flags;
????????????if?(bSynch)
????????????????Flags?=?SND_FILENAME?|?SND_SYNC;
????????????else
????????????????Flags?=?SND_FILENAME?|?SND_ASYNC;
????????????return?PlaySound(strSoundFile?IntPtr.Zero?Flags);
????????}
????}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????4608??2014-10-24?13:41??Speech\FD.Common\bin\Debug\FD.Common.dll
?????文件??????11776??2014-10-24?13:41??Speech\FD.Common\bin\Debug\FD.Common.pdb
?????文件???????2497??2014-10-24?13:31??Speech\FD.Common\FD.Common.csproj
?????文件????????382??2014-10-24?13:31??Speech\FD.Common\obj\Debug\FD.Common.csproj.FileListAbsolute.txt
?????文件???????4608??2014-10-24?13:41??Speech\FD.Common\obj\Debug\FD.Common.dll
?????文件??????11776??2014-10-24?13:41??Speech\FD.Common\obj\Debug\FD.Common.pdb
?????文件???????1368??2014-10-24?13:30??Speech\FD.Common\Properties\AssemblyInfo.cs
?????文件???????1797??2014-10-24?13:41??Speech\FD.Common\SoundPlay.cs
?????文件???????4608??2014-10-24?13:41??Speech\Speech\bin\Debug\FD.Common.dll
?????文件??????11776??2014-10-24?13:41??Speech\Speech\bin\Debug\FD.Common.pdb
?????文件?????122284??2014-10-24?12:46??Speech\Speech\bin\Debug\sound\BankPwd.wav
?????文件?????123884??2014-10-24?12:58??Speech\Speech\bin\Debug\sound\InHosCard.wav
?????文件??????86764??2014-10-24?12:45??Speech\Speech\bin\Debug\sound\InsertBank.wav
?????文件?????127084??2014-10-24?12:54??Speech\Speech\bin\Debug\sound\InsertBankSociate.wav
?????文件?????118444??2014-10-24?12:49??Speech\Speech\bin\Debug\sound\InsertPatient.wav
?????文件??????59884??2014-10-24?12:53??Speech\Speech\bin\Debug\sound\OutBank.wav
?????文件??????62124??2014-10-24?12:52??Speech\Speech\bin\Debug\sound\OutPatient.wav
?????文件?????104044??2014-10-24?12:55??Speech\Speech\bin\Debug\sound\SociatePwd.wav
?????文件???????8704??2014-10-24?13:41??Speech\Speech\bin\Debug\Speech.exe
?????文件??????24064??2014-10-24?13:41??Speech\Speech\bin\Debug\Speech.pdb
?????文件??????11592??2014-10-24?13:41??Speech\Speech\bin\Debug\Speech.vshost.exe
?????文件????????712??2014-10-24?13:41??Speech\Speech\Form1.cs
?????文件???????3663??2014-10-24?13:35??Speech\Speech\Form1.Designer.cs
?????文件???????5814??2014-10-24?13:35??Speech\Speech\Form1.resx
?????文件???????2561??2014-10-24?13:41??Speech\Speech\obj\Debug\ResolveAssemblyReference.cache
?????文件????????761??2014-10-24?13:41??Speech\Speech\obj\Debug\Speech.csproj.FileListAbsolute.txt
?????文件????????847??2014-10-24?13:41??Speech\Speech\obj\Debug\Speech.csproj.GenerateResource.Cache
?????文件???????8704??2014-10-24?13:41??Speech\Speech\obj\Debug\Speech.exe
?????文件????????180??2014-10-24?13:41??Speech\Speech\obj\Debug\Speech.Form1.resources
?????文件??????24064??2014-10-24?13:41??Speech\Speech\obj\Debug\Speech.pdb
............此處省略34個文件信息
評論
共有 條評論