private void Form_KeyPress(object sender, KeyPressEventArgs e) { if (char.TryParse(Name, out char c)) { if (e.KeyChar == c) { SoundForm.PlaySoundAsync(); } } if (e.KeyChar == ' ') { AudioSound.StopAll(); //Stop sounds } }
private void SelectSound_FormClosed(object sender, FormClosedEventArgs e) { //Stop sounds //if (Sound != null) Sound.Stop(); AudioSound.StopAll(); }
private void StopButton_Click(object sender, EventArgs e) { //Stop sounds //if (Sound != null) Engine.Init(Sound); AudioSound.StopAll(); }