소스정리

This commit is contained in:
2025-12-12 20:00:33 +09:00
parent 4e9d29d22f
commit f507a6487e
9 changed files with 76 additions and 22 deletions

View File

@@ -8,7 +8,11 @@ using System.Media;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using System;
#if SPEECH
using Microsoft.Speech.Synthesis;
#endif
using System.Threading.Tasks;
using System.Data.SqlClient;
using System.Linq;
@@ -69,8 +73,9 @@ namespace Project
/// 디버그모니터용 소켓(데이터를 전송만 한다)
/// </summary>
public static Device.Socket sock_debug;
#if SPEECH
private static SpeechSynthesizer voice;
#endif
public static SoundPlayer mplayer;
[DllImport("winmm.dll")]
@@ -108,6 +113,7 @@ namespace Project
Console.WriteLine("speech disabled");
return;
}
#if SPEECH
if (force)
voice.SpeakAsyncCancelAll();
if (voice.State == SynthesizerState.Ready)
@@ -117,6 +123,9 @@ namespace Project
if (logcate.isEmpty()) logcate = "SPEAK";
PUB.log.Add(logcate, m);
}
#else
PUB.log.Add($"스피치컴파일상수OFF");
#endif
}
/// <summary>
@@ -228,7 +237,7 @@ namespace Project
PUB.mplayer.SoundLocation = PUB.setting.musicfile;
SetVolume(PUB.setting.musicvol);
}
#if SPEECH
voice = new SpeechSynthesizer();
try
{
@@ -256,7 +265,7 @@ namespace Project
// 음성 설정 실패 시 기본값 사용
}
voice.SetOutputToDefaultAudioDevice();
#endif
var file_version = System.IO.Path.Combine(UTIL.CurrentPath, "version.txt");
if (System.IO.File.Exists(file_version))
{