|
|
@@ -1,5 +1,6 @@
|
|
|
using System;
|
|
|
using System.Drawing;
|
|
|
+using System.Media;
|
|
|
using System.Threading;
|
|
|
using System.Windows.Forms;
|
|
|
using UAS_MES.PublicMethod;
|
|
|
@@ -37,14 +38,13 @@ namespace UAS_MES.CustomControl.RichText
|
|
|
{
|
|
|
FileName = Application.StartupPath + @"\Resources\Sound\5185.wav";
|
|
|
thread.Start();
|
|
|
- thread = new Thread(PlaySound);
|
|
|
+
|
|
|
}
|
|
|
- else if(color == Color.Green && Entity.SystemInf.CheckAudioEnable)
|
|
|
+ else if (color == Color.Green && Entity.SystemInf.CheckAudioEnable)
|
|
|
{
|
|
|
//颜色是绿色,进行正确提示音
|
|
|
FileName = Application.StartupPath + @"\Resources\Sound\8378.wav";
|
|
|
thread.Start();
|
|
|
- thread = new Thread(PlaySound);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -66,7 +66,7 @@ namespace UAS_MES.CustomControl.RichText
|
|
|
thread.Start();
|
|
|
thread = new Thread(PlaySound);
|
|
|
}
|
|
|
- else if(color == Color.Green && Entity.SystemInf.CheckAudioEnable)
|
|
|
+ else if (color == Color.Green && Entity.SystemInf.CheckAudioEnable)
|
|
|
{
|
|
|
//颜色是绿色,进行正确提示音
|
|
|
FileName = Application.StartupPath + @"\Resources\Sound\8378.wav";
|
|
|
@@ -84,15 +84,14 @@ namespace UAS_MES.CustomControl.RichText
|
|
|
}
|
|
|
try
|
|
|
{
|
|
|
- SpeechLib.SpVoiceClass pp = new SpeechLib.SpVoiceClass();
|
|
|
- SpeechLib.SpFileStreamClass spFs = new SpeechLib.SpFileStreamClass();
|
|
|
- spFs.Open(FileName, SpeechLib.SpeechStreamFileMode.SSFMOpenForRead, true);
|
|
|
- SpeechLib.ISpeechBaseStream Istream = spFs as SpeechLib.ISpeechBaseStream;
|
|
|
- pp.SpeakStream(Istream, SpeechLib.SpeechVoiceSpeakFlags.SVSFIsFilename);
|
|
|
- spFs.Close();
|
|
|
+ SoundPlayer player = new SoundPlayer();
|
|
|
+ player.SoundLocation = FileName;
|
|
|
+ player.Load();
|
|
|
+ player.Play();
|
|
|
}
|
|
|
- catch (Exception)
|
|
|
+ catch (Exception e)
|
|
|
{
|
|
|
+ MessageBox.Show(e.Message);
|
|
|
Entity.SystemInf.CheckAudioEnable = false;
|
|
|
}
|
|
|
}
|