Israel

Israel

  • 1k
  • 1.3k
  • 166.4k

why its doesnt play???

Dec 13 2014 7:54 PM
Hi!


I wrote this code to make my wav playing when I click my button. There is no bugg(s). But its doesnt play. I dont understand why? Very strange. Any help please:


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

namespace Playing_sounds
{
    public partial class Form1 : Form
    {
        private SoundPlayer _soundPlayer;

        public Form1()
        {
            InitializeComponent();
            _soundPlayer = new SoundPlayer("Bass Line.wav");

        }
        private void duelStateButton_CheckedChanged(object sender, EventArgs e)
        {
            if (duelStateButton.Checked)
            {
                duelStateButton.Text = "Stop";
                _soundPlayer.Play();
            }
            else
            {
                duelStateButton.Text = "Play";
                _soundPlayer.Stop();
            }
        }

    }
}


Answers (1)