none
is it possible to add sound effect to the Kinect Paint button? RRS feed

  • Question

  • hi all!

    sorry for my bad English and straight forwarding.

    i have something about the coding to ask...

    i would like to ask, is it possible to add sound for all the button?

    seems like the button with a "click" sound when it is selected would be nice.

    anyone have any idea to do it?

    is it add the .wav file source in somewhere here?

                new BrushSelection(
                    new Uri("/KinectPaint;component/Resources/pen-unselected.png", UriKind.RelativeOrAbsolute), 
                    new Uri("/KinectPaint;component/Resources/pen-selected.png", UriKind.RelativeOrAbsolute), 
                    KinectPaintbrush.Marker, 
                    "pen"),
    

    or ===>>>>

    SoundPlayer ClickSound = new SoundPlayer(@"c:\Media\ClickSound.wav");
        ClickSound.Play();
    

    =====>>>>

    need guidance here. thanks in advance!


    kendrick0772

    Saturday, April 14, 2012 7:50 AM

Answers

  • Hi Kendrick,

    Playing sound code can be placed in this event. The button is said to be selected as the hover animation finishes.

        // Fires when the hover animation is finished, so we can inform any listeners (like buttons) so they can do their thing.
            private void OnHoverStoryboardComplete(object sender, EventArgs e)
            {
                if (HoverFinished != null)
                    HoverFinished(this, new EventArgs());
    
                EndHover();
                _isHovering = false;
    
    
                System.Media.SoundPlayer sp = new System.Media.SoundPlayer("Pop-5.wav");
                sp.Play();
            }

    Thanks

    Bharat.

    Sunday, April 15, 2012 12:36 PM

All replies

  • Hi Kendrick,

    Playing sound code can be placed in this event. The button is said to be selected as the hover animation finishes.

        // Fires when the hover animation is finished, so we can inform any listeners (like buttons) so they can do their thing.
            private void OnHoverStoryboardComplete(object sender, EventArgs e)
            {
                if (HoverFinished != null)
                    HoverFinished(this, new EventArgs());
    
                EndHover();
                _isHovering = false;
    
    
                System.Media.SoundPlayer sp = new System.Media.SoundPlayer("Pop-5.wav");
                sp.Play();
            }

    Thanks

    Bharat.

    Sunday, April 15, 2012 12:36 PM
  • Hi Kendrick,

    Playing sound code can be placed in this event. The button is said to be selected as the hover animation finishes.

        // Fires when the hover animation is finished, so we can inform any listeners (like buttons) so they can do their thing.
            private void OnHoverStoryboardComplete(object sender, EventArgs e)
            {
                if (HoverFinished != null)
                    HoverFinished(this, new EventArgs());
    
                EndHover();
                _isHovering = false;
    
    
                System.Media.SoundPlayer sp = new System.Media.SoundPlayer("Pop-5.wav");
                sp.Play();
            }

    Thanks

    Bharat.

    thanks, Bharat!

    i will try it! then keep on update here.

    thanks again!


    kendrick0772

    Sunday, April 15, 2012 3:09 PM
  • @Bharat

    i've tried it.
    seems it works!

    hmmm, but...is it possible to make each button with different sound effect?

    idea for example,

    button "_availableBrushes" (contains of pen, brush, airbrush)
    pen = pen.wav
    brush = brush.wav
    airbrush = airbrush.wav

    any idea?

    kendrick0772

    Sunday, April 15, 2012 4:22 PM