Answers for "how to play a sound on button click c#"

C#
0

how to play a sound on button click c#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Media;

namespace soundboard
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
           SoundPlayer splayer = new SoundPlayer(@"D:\google downloads\[ontiva.com] Rick Astley - Never Gonna Give You UP (video)-320k.wav");
            splayer.Play();
        }
    }
Posted by: Guest on September-24-2020

Code answers related to "how to play a sound on button click c#"

C# Answers by Framework

Browse Popular Code Answers by Language