diff --git a/TIASshot/CalibDone.wav b/TIASshot/CalibDone.wav
new file mode 100644
index 0000000..e9e3926
--- /dev/null
+++ b/TIASshot/CalibDone.wav
Binary files differ
diff --git a/TIASshot/CameraBase.cs b/TIASshot/CameraBase.cs
index edcab74..c392cf7 100644
--- a/TIASshot/CameraBase.cs
+++ b/TIASshot/CameraBase.cs
@@ -12,6 +12,7 @@
using System.Threading.Tasks;
using System.Windows.Controls;
using System.Windows.Forms;
+using System.Media;
using OpenCvSharp;
using OpenCvSharp.Aruco;
@@ -122,6 +123,7 @@
SetInfo("データ名", _form.GetDataName());
SetInfo("撮影枚数", "1");
Shot();
+ EventSound(Config.GetString("Sound/OneShotDone"));
_form.ShowMessage("撮影終了");
}
@@ -134,6 +136,7 @@
SetInfo("撮影枚数", $"{_form.GetNumMultiShots()}");
SetInfo("撮影間隔(ms)", $"{_form.GetMultiShotsInterval()}");
Shot(_form.GetNumMultiShots(), _form.GetMultiShotsInterval());
+ EventSound(Config.GetString("Sound/MultiShotDone"));
_form.ShowMessage("撮影終了");
}
@@ -309,6 +312,7 @@
_convRGB2SRGB.Add(channel, convRGB2SRGB);
}
+ EventSound(Config.GetString("Sound/CalibDone"));
_form.ShowMessage("自動校正完了");
_form.EnableShots();
_calibrated = true;
@@ -524,5 +528,19 @@
sw.WriteLine($"{kvp.Key},{kvp.Value}");
}
}
+
+ private void EventSound(string wavfile) {
+ if (!File.Exists(wavfile)) {
+ Debug.WriteLine($"音声ファイルが見つかりません: {wavfile}");
+ return;
+ }
+ try {
+ using (var player = new SoundPlayer(wavfile)) {
+ player.Play();
+ }
+ } catch (Exception ex) {
+ Debug.WriteLine($"音声再生に失敗しました: {ex.Message}");
+ }
+ }
}
}
diff --git a/TIASshot/MultiShot.wav b/TIASshot/MultiShot.wav
new file mode 100644
index 0000000..5dae0cd
--- /dev/null
+++ b/TIASshot/MultiShot.wav
Binary files differ
diff --git a/TIASshot/OneShot.wav b/TIASshot/OneShot.wav
new file mode 100644
index 0000000..9c9c096
--- /dev/null
+++ b/TIASshot/OneShot.wav
Binary files differ
diff --git a/TIASshot/TIASshot.csproj b/TIASshot/TIASshot.csproj
index 7a736a4..a3cd689 100644
--- a/TIASshot/TIASshot.csproj
+++ b/TIASshot/TIASshot.csproj
@@ -174,6 +174,7 @@
copy /Y $(ProjectDir)tcc_xyz.csv $(TargetDir)
copy /Y $(ProjectDir)DFK33UX178.xml $(TargetDir)
copy /Y $(ProjectDir)DFK23UX249.xml $(TargetDir)
+copy /Y $(ProjectDir)*.wav $(TargetDir)
\ No newline at end of file
diff --git a/TIASshot/config.xml b/TIASshot/config.xml
index 0205db9..b8db020 100644
--- a/TIASshot/config.xml
+++ b/TIASshot/config.xml
@@ -45,4 +45,9 @@
Silicon Labs CP210x
38400
+
+ CalibDone.wav
+ OneShot.wav
+ MultiShot.wav
+