当前位置: 首页>>代码示例>>C#>>正文


C# AudioEngine.Update方法代码示例

本文整理汇总了C#中Microsoft.Xna.Framework.Audio.AudioEngine.Update方法的典型用法代码示例。如果您正苦于以下问题:C# AudioEngine.Update方法的具体用法?C# AudioEngine.Update怎么用?C# AudioEngine.Update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Microsoft.Xna.Framework.Audio.AudioEngine的用法示例。


在下文中一共展示了AudioEngine.Update方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Audio

 /// <summary>
 /// Initialises the Audio engine
 /// </summary>
 /// <param name="audioFilePath">A string containing the file path to your Xact file ( make sure to put ".xgs" at the end of the string i.e - "Content\\example.xgs"</param>
 public Audio(string audioFilePath)
 {
     // Initialize audio objects.
     engine = new AudioEngine(audioFilePath);
     //"Content\\Audio\\PlaySound.xgs");
     soundBank = new SoundBank(engine, "Content\\Sound Bank.xsb");
     // Create streaming wave bank.
     waveBank = new WaveBank(engine, "Content\\Wave Bank.xwb");
     // must call update
     engine.Update();
 }
开发者ID:bradleat,项目名称:trafps,代码行数:15,代码来源:Audio.cs

示例2: SoundManager

 private SoundManager()
 {
     _audioEngine = new AudioEngine("Content/Sounds/TetrisGame.xgs");
     _waveBank = new WaveBank(_audioEngine, "Content/Sounds/WaveBank.xwb");
     _soundBank = new SoundBank(_audioEngine, "Content/Sounds/SoundBank.xsb");
     _audioEngine.Update();
     _currentMusic = _soundBank.GetCue("m_Silence");
     _currentMusic.Stop(AudioStopOptions.Immediate);
     _currentSounds = new Cue[20];
     SetMusicVolume(100);
     SetSoundVolume(100);
 }
开发者ID:kavengagne,项目名称:TetrisGame,代码行数:12,代码来源:SoundManager.cs

示例3: AudioManager

        /// <summary>
        /// Initialize the audio manager.
        /// </summary>
        public AudioManager()
        {
            engine = new AudioEngine("Resources/Audio/Equinox.xgs");

            sfxWaveBank = new WaveBank(engine, "Resources/Audio/Sound.xwb");
            sfxSoundBank = new SoundBank(engine, "Resources/Audio/Sound.xsb");

            musicWaveBank = new WaveBank(engine, "Resources/Audio/Music.xwb", 0, (short) 16);
            musicSoundBank = new SoundBank(engine, "Resources/Audio/Music.xsb");

            engine.Update();
        }
开发者ID:jreese,项目名称:equinox,代码行数:15,代码来源:AudioManager.cs

示例4: LoadSoundContent

        public static void LoadSoundContent(string basePath)
        {
            basePath += "/";
            audio = new AudioEngine(basePath + "sound/music/AnimoNex.xgs");
            waves = new WaveBank(audio, basePath + "sound/music/Wave Bank.xwb");
            soundBank = new SoundBank(audio, basePath + "sound/music/Sound Bank.xsb");

            musicAudio = new AudioEngine(basePath + "sound/music/AnimoNexMusic.xgs");
            music = new WaveBank(musicAudio,basePath + "sound/music/musicWaves.xwb",0,8);
            musicSoundBank = new SoundBank(musicAudio, basePath + "sound/music/musicSoundBank.xsb");

            musicAudio.Update();
            mainMenuFunc.mm_introMusic = sounds.musicSoundBank.GetCue("mm_intro");
            mainMenuFunc.mm_LoopingMusic = sounds.musicSoundBank.GetCue("mm_loop");
        }
开发者ID:mrpossoms,项目名称:AnimoNex,代码行数:15,代码来源:sounds.cs

示例5: Init

        public override bool Init()
        {
            clavier = new KeyboardState();
            clavier_prec = Keyboard.GetState();

            spriteBatch = new SpriteBatch(graphics.GraphicsDevice);
            texte = Content.Load<SpriteFont>("Polices/menu");
            image_fail = Content.Load<Texture2D>("Images/BackGround_PERDU");
            metal_tex = Content.Load<Texture2D>("Images/blanc");

            // Sons et musiques
            Audio = new AudioEngine("Content/Musiques/ambiance.xgs");
            // Chargement des banques
            BanqueSon = new SoundBank(Audio, "Content/Musiques/Sound Bank.xsb");
            BanqueWave = new WaveBank(Audio, "Content/Musiques/Wave Bank.xwb");

            son_menu_validation = "menu_validation";

            Audio.Update();

            return base.Init();
        }
开发者ID:Noxalus,项目名称:aMAZEing-Escape,代码行数:22,代码来源:Fail.cs

示例6: TowerAudioEngine

        public TowerAudioEngine(BaseModel baseModel)
        {
          try
          {
            this.baseModel = baseModel;

            audioEngine = new AudioEngine("Content/8bit.xgs");
            audioEngine.Update();

            //setting the values in App.Instance.Music
            App.Instance.Model.Music.TimeSignature = new TimeSignature(4, 4);
            App.Instance.Model.Music.Tempo = 60;
            App.Instance.Model.Music.ClicksPerBeat = 4;

            //this is needed as the constructor does something magical which allows the sounds to play
            waveBanks = new LinkedList<WaveBank>();
            waveBanks.Add(new WaveBank(audioEngine, "Content/Drum Bank.xwb"));
            waveBanks.Add(new WaveBank(audioEngine, "Content/Effect Bank.xwb"));
            waveBanks.Add(new WaveBank(audioEngine, "Content/Eva Bank.xwb"));
            waveBanks.Add(new WaveBank(audioEngine, "Content/Simpleb Bank.xwb"));
            waveBanks.Add(new WaveBank(audioEngine, "Content/Spaceb Bank.xwb"));
            waveBanks.Add(new WaveBank(audioEngine, "Content/Weeping Bank.xwb"));

            drumPlayer = new DrumPlayer(audioEngine);
            melodyPlayer = new MelodyPlayer(audioEngine);
            effectPlayer = new EffectPlayer(audioEngine, this);

            App.Instance.Model.Music.Click += new EventHandler(OnClick);
            App.Instance.Model.Music.Beat += new EventHandler(OnBeat);
            App.Instance.Model.Music.Bar += new EventHandler(OnBar);
            App.Instance.Model.Update += new EventHandler<SurfaceTower.Model.EventArguments.UpdateArgs>(OnUpdate);
          }
          catch (InvalidOperationException)
          {
            Console.WriteLine("There is no audio device plugged in. AudioEngine will not be used.");
          }
        }
开发者ID:Daniel-Nichol,项目名称:ox-g1-surface,代码行数:37,代码来源:TowerAudioEngine.cs

示例7: Initialize

        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            base.Initialize();
            Root.DisplayManager.WindowTitle = "Audio Test";
            sceneGraph = new gxtSceneGraph();
            Content.RootDirectory = "Content";
            audioEngine = new AudioEngine("Content\\Audio\\gxt_test_sounds.xgs");
            soundBank = new SoundBank(audioEngine, "Content\\Audio\\gxt_test_sound_bank.xsb");
            waveBank = new WaveBank(audioEngine, "Content\\Audio\\gxt_test_wave_bank.xwb");

            audioEngine.Update();

            Cue cue = soundBank.GetCue("park_1");
            cue.Play();
            if (gxtDebugDrawer.SingletonIsInitialized)
            {
                debugDrawerId = gxtDebugDrawer.Singleton.GetNewId();
                gxtDebugDrawer.Singleton.AddSceneGraph(debugDrawerId, sceneGraph);
                gxtDebugDrawer.Singleton.CurrentSceneId = debugDrawerId;
                //gxtDebugDrawer.Singleton.SetTargetDrawManager(world.DrawManager);
                gxtDebugDrawer.Singleton.DebugFont = Content.Load<SpriteFont>("Fonts\\debug_font");
                //gxtDebugDrawer.Singleton.SetDebugFont(Root);
            }
        }
开发者ID:Loko,项目名称:GXT,代码行数:30,代码来源:AudioTestGame.cs

示例8: LoadContent

        /// <summary>
        /// Loads graphics content for this screen. The background texture is quite
        /// big, so we use our own local ContentManager to load it. This allows us
        /// to unload before going from the menus into the game itself, wheras if we
        /// used the shared ContentManager provided by the Game class, the content
        /// would remain loaded forever.
        /// </summary>
        public override void LoadContent()
        {
            if (content == null)
                content = new ContentManager(ScreenManager.Game.Services, "Content");

            backgroundTexture = content.Load<Texture2D>("SpaceBackground");

            audioEngine = new AudioEngine("Content\\soundProject.xgs");
            waveBankSFX = new WaveBank(audioEngine, "Content\\SFX.xwb");
            waveBankBGM = new WaveBank(audioEngine, "Content\\BGM.xwb", 0, 4);
            soundBank = new SoundBank(audioEngine, "Content\\Sound Bank.xsb");

            audioEngine.Update();

            musicCategory = audioEngine.GetCategory("Music");

            musicCategory.SetVolume(OptionsMenuScreen.bgmVolume / 10);

            soundBank.GetCue("menubgm").Play();
        }
开发者ID:iAbee,项目名称:CSGDAssignment3,代码行数:27,代码来源:BackgroundScreen.cs

示例9: LoadContent

        /// <summary>
        /// Load graphics content for the game.
        /// </summary>
        public override void LoadContent()
        {
            if (content == null)
                content = new ContentManager(ScreenManager.Game.Services, "Content");

            gameFont = content.Load<SpriteFont>("gamefont");

            #region Effects

            ToonEffect = content.Load<Effect>("Toon");
            ToonTexture = content.Load<Texture2D>("SketchTexture");

            bloomEffects = new BloomComponent(ScreenManager.Game);
            ScreenManager.Game.Components.Add(bloomEffects);
            bloomEffects.Settings = BloomSettings.PresetSettings[bloomSettingsIndex];

            bloomEffects.Visible = OptionsMenuScreen.BloomOn;

            #endregion

            Player1Texture = content.Load<Texture2D>("Player1");
            BulletTexture = content.Load<Texture2D>("Bullet");
            ParticleTexture = content.Load<Texture2D>("Laser");
            ShipParticleTexture = content.Load<Texture2D>("Glow");
            enemyTexture01 = content.Load<Texture2D>("Enemy_01");
            enemyTexture02 = content.Load<Texture2D>("Enemy_02");
            enemyTexture03 = content.Load<Texture2D>("Enemy_03");

            asteroidsModel = content.Load<Model>("Asteroids");

            audioEngine = new AudioEngine("Content\\soundProject.xgs");
            waveBankSFX = new WaveBank(audioEngine, "Content\\SFX.xwb");
            waveBankBGM = new WaveBank(audioEngine, "Content\\BGM.xwb", 0, 4);
            soundBank = new SoundBank(audioEngine, "Content\\Sound Bank.xsb");

            emitter = new AudioEmitter();
            listener = new AudioListener();

            audioEngine.Update();

            defaultCategory = audioEngine.GetCategory("Default");

            defaultCategory.SetVolume(OptionsMenuScreen.sfxVolume / 10);

            musicCategory = audioEngine.GetCategory("Music");

            musicCategory.SetVolume(OptionsMenuScreen.bgmVolume / 10);

            cue = soundBank.GetCue("gamebgm");

            cue.Play();

            GameStart();

            // A real game would probably have more content than this sample, so
            // it would take longer to load. We simulate that by delaying for a
            // while, giving you a chance to admire the beautiful loading screen.
            Thread.Sleep(1000);

            // once the load has finished, we use ResetElapsedTime to tell the game's
            // timing mechanism that we have just finished a very long frame, and that
            // it should not try to catch up.
            ScreenManager.Game.ResetElapsedTime();
        }
开发者ID:iAbee,项目名称:CSGDAssignment3,代码行数:67,代码来源:GameplayScreen.cs

示例10: LoadContent

        public override void LoadContent()
        {
            if (content == null)
                content = new ContentManager(ScreenManager.Game.Services, "Content");

            audioEngine = new AudioEngine("Content\\soundProject.xgs");
            waveBankSFX = new WaveBank(audioEngine, "Content\\SFX.xwb");
            waveBankBGM = new WaveBank(audioEngine, "Content\\BGM.xwb", 0, 4);
            soundBank = new SoundBank(audioEngine, "Content\\Sound Bank.xsb");

            audioEngine.Update();

            defaultCategory = audioEngine.GetCategory("Default");

            defaultCategory.SetVolume(OptionsMenuScreen.sfxVolume / 10);
        }
开发者ID:iAbee,项目名称:CSGDAssignment3,代码行数:16,代码来源:OptionsMenuScreen.cs

示例11: Initialize

        public static void Initialize(Game game)
        {
            SoundManager.content = game.Content;
            soundEffects = new List<SoundEffectInstance>();
            effectsLib = new Dictionary<SoundEffects, string>();
            audioEngine = new AudioEngine(settingsFile);
            musicWaveB = new WaveBank(audioEngine, musicWaveBank);
            waveBank = new WaveBank(audioEngine, waveBankName);
            soundBank = new SoundBank(audioEngine, soundbankName);

            //effectsLib.Add(SoundEffects.SHIFT_1, "ferrarif355 1");
            //effectsLib.Add(SoundEffects.SHIFT_2, "ferrarif355 2");
            //effectsLib.Add(SoundEffects.SHIFT_3, "ferrarif355 3");
            //effectsLib.Add(SoundEffects.SHIFT_4, "ferrarif355 4");
            effectsLib.Add(SoundEffects.SHIFT_1, "evo7 1");
            effectsLib.Add(SoundEffects.SHIFT_2, "evo7 2");
            effectsLib.Add(SoundEffects.SHIFT_3, "evo7 3");
            effectsLib.Add(SoundEffects.SHIFT_4, "evo7 4");
            effectsLib.Add(SoundEffects.CHECKPOINT_1, "checkpoint");
            effectsLib.Add(SoundEffects.CROWDSOUND, "CrowdCheering");
            effectsLib.Add(SoundEffects.SONG, "LevelSong");
            effectsLib.Add(SoundEffects.CRASH_1, "crash1");
            effectsLib.Add(SoundEffects.CRASH_2, "crash2");
            effectsLib.Add(SoundEffects.CRASH_3, "crash3");
            effectsLib.Add(SoundEffects.ROAD_RIDE, "road-ride");
            effectsLib.Add(SoundEffects.OUTOFROAD, "outOfRoad");
            effectsLib.Add(SoundEffects.OUTOFTIME, "TimeUp");

            audioEngine.Update();
        }
开发者ID:hateftad,项目名称:MathRacer,代码行数:30,代码来源:SoundManager.cs

示例12: Init

        public override bool Init()
        {
            menu = new string[] { "Nouvelle Partie", "Reprendre", "Options", "Crédits", "Quitter" };
            curseur = 0;
            clavier = new KeyboardState();
            clavier_prec = Keyboard.GetState();

            spriteBatch = new SpriteBatch(graphics.GraphicsDevice);
            texte = Content.Load<SpriteFont>("Polices/menu");
            banniere = Content.Load<Texture2D>("Images/banniere");

            // Sons et musiques
            Audio = new AudioEngine("Content/Musiques/ambiance.xgs");
            // Chargement des banques
            BanqueSon = new SoundBank(Audio, "Content/Musiques/Sound Bank.xsb");
            BanqueWave = new WaveBank(Audio, "Content/Musiques/Wave Bank.xwb");
            Config.musique_menu = BanqueSon.GetCue("menu");
            son_menu_curseur = "menu_curseur";
            son_menu_validation = "menu_validation";
            son_menu_retour = "menu_retour";
            Config.musique_menu.Play();
            Audio.Update();

            compteur_decalage = 0;

            return base.Init();
        }
开发者ID:Noxalus,项目名称:aMAZEing-Escape,代码行数:27,代码来源:Menu_Principal.cs

示例13: LoadContent

        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Set Some Variables
            float padX  = 24; // Paddle Width
            float padY  = 64; // Paddle Height
            float ballD = 32; // Ball Diameter
            Random rnd = new Random();

            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // Load the SoundEffect resource
            walls = Content.Load<SoundEffect>("VOLTAGE");
            miss  = Content.Load<SoundEffect>("neat");
            win   = Content.Load<SoundEffect>("score");
            lose  = Content.Load<SoundEffect>("miss");
            killshot = Content.Load<SoundEffect>("killshot");

            // Load files built from XACT project
            audioEngine = new AudioEngine("Content\\Lab3Sounds.xgs");
            waveBank    = new WaveBank(audioEngine, "Content\\Wave Bank.xwb");
            soundBank   = new SoundBank(audioEngine, "Content\\Sound Bank.xsb");

            // Load streaming wave bank
            streamingWaveBank = new WaveBank(audioEngine, "Content\\Music.xwb", 0, 4);
            // The audio engine must be updated before the streaming cue is ready
            audioEngine.Update();
            // Get cue for streaming music
            musicCue = soundBank.GetCue("EricJordan_2012_30sec");
            // Start the background music
            musicCue.Play();

            // Load Font
            Font1 = Content.Load<SpriteFont>("Courier New");

            // Load a 2D texture sprite
            ball     = new clsSprite(Content.Load<Texture2D>("volt-ball-final"),
                            new Vector2(winX/2, winY/2), new Vector2(ballD, ballD),
                            winX, winY);
            opponent = new clsSprite(Content.Load<Texture2D>("vt_left_paddle"),
                            new Vector2(10, winY/2 - padY), new Vector2(padX, padY),
                            winX, winY);
            player   = new clsSprite(Content.Load<Texture2D>("vt_right_paddle"),
                            new Vector2(winX - (10+padX), winY / 2 - padY), new Vector2(padX, padY),
                            winX, winY);
            // Create a SpriteBatch to render the sprite
            spriteBatch = new SpriteBatch(graphics.GraphicsDevice);

            // Set the velocity of the ball sprites will move
            ball.velocity = new Vector2(rnd.Next(3,6), rnd.Next(-5, 6));
        }
开发者ID:pevargas,项目名称:8-Bit-Rhino,代码行数:55,代码来源:Game1.cs

示例14: Init

        public override bool Init()
        {
            credits_animation = 150;
            fond_credits = Content.Load<Texture2D>("Images/fond_credits");
            pause = false;
            rotation = 0f;
            vitesse = 0.85f;

            credits = TableauCredits("Content/Crédits/credits.42");

            clavier = new KeyboardState();
            clavier_prec = Keyboard.GetState();

            spriteBatch = new SpriteBatch(graphics.GraphicsDevice);
            texte = Content.Load<SpriteFont>("Polices/menu");

            noir = Content.Load<Texture2D>("Images/black");
            photos = new Texture2D[4];
            photos[0] = Content.Load<Texture2D>("Photos/jarri_j");
            photos[1] = Content.Load<Texture2D>("Photos/chevri_t");
            photos[2] = Content.Load<Texture2D>("Photos/decast_k");
            photos[3] = Content.Load<Texture2D>("Photos/chigue_w");

            // Sons et musiques
            Audio = new AudioEngine("Content/Musiques/ambiance.xgs");
            // Chargement des banques
            BanqueSon = new SoundBank(Audio, "Content/Musiques/Sound Bank.xsb");
            BanqueWave = new WaveBank(Audio, "Content/Musiques/Wave Bank.xwb");

            musique = BanqueSon.GetCue("credits");

            Config.musique_menu.Stop(AudioStopOptions.Immediate);
            Config.musique_menu.Dispose();

            musique.Play();

            son_menu_retour = "menu_retour";
            Audio.Update();

            return base.Init();
        }
开发者ID:Noxalus,项目名称:aMAZEing-Escape,代码行数:41,代码来源:Credits.cs

示例15: SetSoundMain

 private void SetSoundMain()
 {
     audioEngine = new AudioEngine("Music\\MySound.xgs");
     waveBank = new WaveBank(audioEngine, "Music\\Wave Bank.xwb", 0, 1024);
     soundBank = new SoundBank(audioEngine, "Music\\Sound Bank.xsb");
     soundCategory = audioEngine.GetCategory("Music");
     audioEngine.Update();
 }
开发者ID:utau1116b,项目名称:Hello-World,代码行数:8,代码来源:WindowsGameSound.cs


注:本文中的Microsoft.Xna.Framework.Audio.AudioEngine.Update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。