Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9116353
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T04:39:09+00:00 2026-06-17T04:39:09+00:00

Followed a few tutorials and I’m having no luck, I’m trying to add a

  • 0

Followed a few tutorials and I’m having no luck, I’m trying to add a simple .WAV sound effect into XNA using free samples, I have named the sound as:

SoundEffect hit1;
SoundEffect hit2;

And then loaded the content with:

hit1= content.load<SoundEffect>("hit1")

But when it comes to adding the play to a button press and I go to test it there’s no sound at all even no errors or nothing the game loads and is playable but any sound effects are not working.

** // Sounds

        SoundEffect hit1;
        SoundEffect hit2;

This is my variable names:

// Sounds

            hit1 = Content.Load<SoundEffect>("hit1");
            hit2 = Content.Load<SoundEffect>("hit2");

This is how I’m loading them in the loadcontent method:

//If Keyboard Key W is Pressed or Buttong Y
                if (keys1.IsKeyDown(Keys.W) && oldKeys1.IsKeyUp(Keys.W)
                    || (oldpad1.Buttons.Y == ButtonState.Released) && (pad1.Buttons.Y == ButtonState.Pressed))
                {
                    secondsPassed = 0;
                    // IF The Target Image is a Gnome 
                    if (targets[0] == sprites[0])
                    {
                        //They whacked a gnome
                        GnomeHits = GnomeHits + 1;
                        runNum = 0;
                        secondsPassed = 0;
                        hit1.Play();

                    }
                    else
                    {
                        //They whacked a troll
                        scoreNum = scoreNum + 1;
                        runNum = runNum + 1;
                        GnomeHits = 0;
                        secondsPassed = 0;
                        hit2.Play();
                    }
                    SetUpSpriteLoop();

And this is one of the control buttons I’m trying to assign sound too
when I hit F5 and run the game when I hit the key or button no sound at all.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T04:39:10+00:00Added an answer on June 17, 2026 at 4:39 am

    My first recommendation would be to make sure you are updating the keyboard presses. I only say that as I can’t see you doing that in your code. If you do not do this then the key states will not update and therefore you will never enter the if statement.

    Once you have ensured you are entering the if statement, I would play around with the volume of the sound effect to make sure it is actually audible. I may be a bit off base there however if I am I suggest following this tutorial rbwhitaker is a great resource for XNA.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I followed a few tutorials (all looking very similar) on using Pusher for realtime
I am trying to configure authentication using a few tutorials I have found on
I've spent MONTHS trying to integrate PayPal into my site, followed countless tutorials, articles
I have followed a few tutorials / stackoverflow threads to learn how to add
I am starting a simple .NET project with FluentNhibernate . I've followed few examples
I have followed a few tutorials on creating a custom property editor dialog, but
I am beginning in iPhone development and have followed a few tutorials, but please
I don't have experience in php. I've followed a few tutorials to modify my
I'm trying to create a simple merch association between two Products. I've followed a
I have followed a few online tutorials and managed to install custom item templates

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.