/// <summary> /// This method play a Wav from a file. /// Using this method you don't need to manage the Wav initialization and disposition when the sound ends /// </summary> /// <param name="filePath">The path of the Wav file</param> public static void playWavFromFile(string filePath) { Wav newWav = loadWavFromFile(filePath); newWav.disposeAtEnd = true; playingWavs.Add(newWav); newWav.Play(); }
/// <summary> /// This method play a Wav from the resources. /// Using this method you don't need to manage the Wav initialization and disposition when the sound ends /// </summary> /// <param name="resource_Name"></param> /// <param name="volume">The volume of the Wav (from 0 to 100)</param> public static void playWavFromResources(string resource_Name, int volume = 100) { Wav newWav = loadWavFromResources(resource_Name, volume, false, new StackTrace().GetFrame(1).GetMethod().ReflectedType.Assembly); newWav.disposeAtEnd = true; playingWavs.Add(newWav); newWav.Play(); }