XNA Creators Club Online
Page 1 of 1 (5 items)
Sort Posts: Previous Next

Problem working with SoundEffect members

Last post 6/12/2009 2:01 AM by krish534. 4 replies.
  • 6/11/2009 3:43 AM

    Problem working with SoundEffect members

    Hi everyone,

    I am trying to use sound effects in my program but i am getting following error when in use SoundEffect members.

    Error: The type or namespace name 'SoundEffect' could not be found (are you missing a using directive or an assembly reference?)   

    I am using Microsoft.Xna.Framework.Audio namespace in the program. I dont know what to do. Can anyone help me?

    here is the code where am getting error....if it help in solving the issue:

    #region Using Statements

    using System;

    using System.Collections.Generic;

    using Microsoft.Xna.Framework;

    using Microsoft.Xna.Framework.Audio;

    using Microsoft.Xna.Framework.Content;

    using Microsoft.Xna.Framework.Graphics;

    using Microsoft.Xna.Framework.Input;

    using Microsoft.Xna.Framework.Storage;

    #endregion

     

    namespace WindowsGame

    {

      

        public class Game1 : Microsoft.Xna.Framework.Game

        {

            GraphicsDeviceManager graphics;

            ContentManager content;

            SpriteBatch spriteBatch;

           

            public Game1()

            {

                graphics = new GraphicsDeviceManager(this);

                content = new ContentManager(Services);

            }

             protected override void Initialize()

            {

                // TODO: Add your initialization logic here

     

                base.Initialize();

            }

            // Set the 3D model to draw.

            Model myModel;

            //Set the sound effects to use

            SoundEffect soundEngine;

            bool soundEnginePlaying = false;

            SoundEffectInstance soundEngineInstance;

            SoundEffect soundHyperspaceActivation;

     

            // The aspect ratio determines how to scale 3d to 2d projection.

            float aspectRatio;  

           }
    }

    Thanks
  • 6/11/2009 4:35 AM In reply to

    Re: Problem working with SoundEffect members

    Doesn't SoundEffect live in Microsoft.Xna.Media? You're not referencing that namespace.
    Also, make sure you're referencing XNA 3.0 assemblies, as the 2.0 ones didn't include SoundEffect AFAICR.
    Jon Watte, Direct3D MVP
    Tweets, occasionally
    kW X-port 3ds Max .X exporter
    kW Animation source code
  • 6/11/2009 2:20 PM In reply to

    Re: Problem working with SoundEffect members

    ok...I Installed and using XNA Game Studio Express 1.0 Refresh download. When I checked the version of assembly it says 1.0.0.0. (by double clicking assemblyinfo.cs under properties of my project).
    So do you think this version don't include SoundEffect class in it?
    how can i add xna 3.0 or 2.0 assemblies to my project?
    what are these assemblies which have soundeffect members(since msdn says that soundeffect class is in microsoft.xna.framework.audio namespace and microsoft.xna.framework assembly....both of which i have in my project)?
    I tried to add microsoft.xna.media but it throughs an error (The type or namespace name 'Media' does not exist in the namespace 'Microsoft.Xna' (are you missing an assembly reference?) )  

    Thank you very much for your help. I appreciate it.

  • 6/11/2009 5:26 PM In reply to
    • (0)
    • premium membership MVP Team XNA
    • Posts 15

    Re: Problem working with SoundEffect members

    As mentioned SoundEffect was only recently introduced in the 3.0 release. These APIs just don't exist in the 1.0 refresh. The same foes for the Media namespace. I highly recommend updating to the latest and greatest release, which happens to have just been released today!

    You can download Game Studio 3.1 here, which does include the Sound Effect APIs.
    http://creators.xna.com/en-US/news/xnagamestudio3.1
    Jason Kepner - XNA Platform Program Manager
  • 6/12/2009 2:01 AM In reply to

    Re: Problem working with SoundEffect members

    thanks for your help. its working.
Page 1 of 1 (5 items) Previous Next