diff --git a/WinFormControl/Utils/SoundPalyUtil.cs b/WinFormControl/Utils/SoundPalyUtil.cs index 9d45b6f..833f3d5 100644 --- a/WinFormControl/Utils/SoundPalyUtil.cs +++ b/WinFormControl/Utils/SoundPalyUtil.cs @@ -20,6 +20,15 @@ namespace WinFormControl player.Load(); player.Play(); } + + public static void PlaySound(string filePath) + { + if (!File.Exists(filePath)) + return; + player.SoundLocation = filePath; + player.Load(); + player.Play(); + } } public enum SoundType