OleVedeler

AudioManager

May 9th, 2012
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.54 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using Microsoft.Xna.Framework;
  5. using Microsoft.Xna.Framework.Audio;
  6. using Microsoft.Xna.Framework.Content;
  7. using Microsoft.Xna.Framework.GamerServices;
  8. using Microsoft.Xna.Framework.Graphics;
  9. using Microsoft.Xna.Framework.Input;
  10. using Microsoft.Xna.Framework.Media;
  11.  
  12.  
  13. namespace wtfGame
  14. {
  15.  
  16.     public class SoundManager : Microsoft.Xna.Framework.DrawableGameComponent
  17.     {
  18.         SoundManager soundManager;
  19.         AudioEngine audioEngine;
  20.         WaveBank waveBank;
  21.         SoundBank soundBank;
  22.         Cue trackCue;
  23.  
  24.  
  25.         public SoundManager(Game game)
  26.             : base(game)
  27.         {
  28.             // TODO: Construct any child components here
  29.         }
  30.  
  31.  
  32.         public override void Initialize()
  33.         {
  34.             // TODO: Add your initialization code here
  35.  
  36.             base.Initialize();
  37.         }
  38.  
  39.         protected override void LoadContent()
  40.         {
  41.             audioEngine = new AudioEngine(@"Content\Audio\GameAudio.xgs");
  42.             waveBank = new WaveBank(audioEngine, @"Content\Audio\wave Bank.xwb");
  43.             soundBank = new SoundBank(audioEngine, @"Content\Audio\Sound Bank.xsb");
  44.             trackCue = soundBank.GetCue("DST-Azum");
  45.             trackCue.Play();
  46.  
  47.             soundBank.PlayCue("DST-Azum");
  48.         }
  49.  
  50.    
  51.         public override void Update(GameTime gameTime)
  52.         {
  53.             // TODO: Add your update code here
  54.             audioEngine.Update();
  55.             base.Update(gameTime);
  56.         }
  57.     }
  58. }
Advertisement
Add Comment
Please, Sign In to add comment