當前位置: 首頁>>代碼示例>>C#>>正文


C# SoundBank.GetCue方法代碼示例

本文整理匯總了C#中Microsoft.Xna.Framework.Audio.SoundBank.GetCue方法的典型用法代碼示例。如果您正苦於以下問題:C# SoundBank.GetCue方法的具體用法?C# SoundBank.GetCue怎麽用?C# SoundBank.GetCue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Microsoft.Xna.Framework.Audio.SoundBank的用法示例。


在下文中一共展示了SoundBank.GetCue方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Initialize

        public static void Initialize()
        {
            audioEngine = new AudioEngine(@"Content\audio\AudioProject.xgs");
            soundBank = new SoundBank(audioEngine, @"Content\audio\SoundBank.xsb");
            waveBank = new WaveBank(audioEngine, @"Content\audio\WaveBank.xwb");

            soundCategory = audioEngine.GetCategory("Sound");

            moveLoop1 = soundBank.GetCue("move_loop_1");
            moveLoop2 = soundBank.GetCue("move_loop_2");
            moveLoop3 = soundBank.GetCue("move_loop_3");
        }
開發者ID:nguyendinhnien,項目名稱:AmazingCup2013-Game-UET,代碼行數:12,代碼來源:AudioManager.cs

示例2: Initialize

        public void Initialize()
        {
            audioEngine = new AudioEngine(@"Content\Audio\FoodFightNow.xgs");
            waveBank = new WaveBank(audioEngine, @"Content\Audio\Wave Bank.xwb");
            soundBank = new SoundBank(audioEngine, @"Content\Audio\GameMusic.xsb");

            _GameOver = soundBank.GetCue("GameOver");
            _Background = soundBank.GetCue("Background");
            _Background.Play();
            _EndPlay = false;
            _NextLevel = soundBank.GetCue("NextLevel");
            _NextLevelSound = false;
            _Victory = soundBank.GetCue("Victory");
            _VictorySound = false;
        }
開發者ID:kentaurus44,項目名稱:FoodFight-2D-3D,代碼行數:15,代碼來源:Audio.cs

示例3: FieldPong

        public FieldPong()
        {
            graphics = new GraphicsDeviceManager(this);
            content = new ContentManager(Services);

            graphics.PreferredBackBufferWidth = 1024;
            graphics.PreferredBackBufferHeight = 768;
            graphics.MinimumPixelShaderProfile = ShaderProfile.PS_2_0;
            graphics.SynchronizeWithVerticalRetrace = true;

            physicsSimulator = new PhysicsSimulator(new Vector2(0));
            physicsSimulator.AllowedPenetration = 0.3f;
            physicsSimulator.BiasFactor = 1.0f;
            Services.AddService(typeof(PhysicsSimulator), physicsSimulator);

            screenManager = new ScreenManager(this);
            Components.Add(screenManager);

            bloomProcessor = new BloomPostProcessor(this);
            Components.Add(bloomProcessor);

            // Uncomment this to monitor the FPS:

            //fpsCounter = new FrameRateCounter(this);
            //Components.Add(fpsCounter);

            audioEngine = new AudioEngine("Content\\Audio\\FieldPongAudio.xgs");
            waveBank = new WaveBank(audioEngine, "Content\\Audio\\Wave Bank.xwb");
            soundBank = new SoundBank(audioEngine, "Content\\Audio\\Sound Bank.xsb");

            backgroundMusic = soundBank.GetCue("GameSong0010 16 Bit");
            backgroundMusic.Play();
        }
開發者ID:zpconn,項目名稱:FieldPong,代碼行數:33,代碼來源:FieldPong.cs

示例4: AudioManager

        public AudioManager(MyGame game)
            : base(game)
        {
            myGame = game;
            events = new List<Event>();
            game.mediator.register(this, MyEvent.C_ATTACK_BULLET_END, MyEvent.M_BITE,
                MyEvent.G_NextLevel, MyEvent.G_GameOver,MyEvent.M_HIT);

            audioEngine = new AudioEngine(@"Content\Audio\GameAudio.xgs");
            waveBank = new WaveBank(audioEngine, @"Content\Audio\Wave Bank.xwb");
            soundBank = new SoundBank(audioEngine, @"Content\Audio\Sound Bank.xsb");

            trackCue =  soundBank.GetCue("Cowboy");
            levelCompleteCue = soundBank.GetCue("LevelComplete");
            trackCue.Play();
            trackCue.Pause();
        }
開發者ID:mahmoudbahaa,項目名稱:XNA-Game-project,代碼行數:17,代碼來源:AudioManager.cs

示例5: DefenderMusic

		public DefenderMusic( SoundBank sounds, AudioEngine engine ) {
			mSounds = sounds;
			mEngine = engine;
			mMusic = sounds.GetCue( "stage_music" );
			mMusicName = mMusic.Name;
			mVolume = 1.0f;
			mMusic.Play();
		}
開發者ID:GodLesZ,項目名稱:svn-dump,代碼行數:8,代碼來源:DefenderMusic.cs

示例6: EffectPlayer

        public EffectPlayer(AudioEngine audioEngine, TowerAudioEngine tae)
        {
            this.towerAudioEngine = tae;
            this.audioEngine = audioEngine;

            soundBank = new SoundBank(audioEngine, "Content/Effect Sound.xsb");

            App.Instance.Model.AddPlayer += new EventHandler<SurfaceTower.Model.EventArguments.PlayerArgs>(OnAddPlayer);
            App.Instance.Model.RemovePlayer += new EventHandler<SurfaceTower.Model.EventArguments.PlayerArgs>(OnRemovePlayer);
            App.Instance.Model.NewEnemy += new EventHandler<SurfaceTower.Model.EventArguments.EnemyArgs>(OnNewEnemy);
            App.Instance.Model.Tower.ZeroHealth += new EventHandler(Tower_ZeroHealth);

            heartbeatCue = soundBank.GetCue("Hearbeat");
            introCue = soundBank.GetCue("Intro");
            introCue.Play();
            firstPlayerHasJoined = false;
        }
開發者ID:Daniel-Nichol,項目名稱:ox-g1-surface,代碼行數:17,代碼來源:EffectPlayer.cs

示例7: XactBgm

        public XactBgm(SoundBank soundBank, WaveBank waveBank, string cueName)
        {
            sb = soundBank;
            wb = waveBank ;

            this.cueName = cueName;

            cue = sb.GetCue(cueName);
        }
開發者ID:TerrariaPrismTeam,項目名稱:Prism,代碼行數:9,代碼來源:IBgm.cs

示例8: Music

 public Music(SoundBank sounds, AudioEngine engine)
 {
     this.sounds = sounds;
     this.engine = engine;
     music = sounds.GetCue("stage_music");
     musicName = music.Name;
     volume = 1.0f;
     music.Play();
 }
開發者ID:kinaesthesia,項目名稱:KDefTower,代碼行數:9,代碼來源:Music.cs

示例9: LoadContent

        internal void LoadContent()
        {
            //Loads the audioengine, wavebank and soundbank
            engine = new AudioEngine(@"Content/Audio/GameAudio.xgs");
            sound = new SoundBank(engine, @"Content/Audio/Sound Bank.xsb");
            wave = new WaveBank(engine, @"Content/Audio/Wave Bank.xwb");

            trackCue = sound.GetCue(songTitle);
            trackCue.Play();
        }
開發者ID:midlas10,項目名稱:XNA_mappe3_Bouncing,代碼行數:10,代碼來源:AudioManager.cs

示例10: LoadContent

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

            audioEngine = new AudioEngine("Content/test.xgs");
            soundBank = new SoundBank(audioEngine,"Content/Sound Bank.xsb");
            waveBank = new WaveBank(audioEngine,"Content/Wave Bank.xwb");

            soundBank.GetCue("ak47").Play();
        }
開發者ID:serapth,項目名稱:MonoGameBook,代碼行數:11,代碼來源:Game1.cs

示例11: 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

示例12: LoadContent

        public void LoadContent()
        {
            engine = new AudioEngine("Content\\Audio\\ButterflyAudio.xgs");
            waveBank = new WaveBank(engine, "Content\\Audio\\Waves.xwb");
            soundBank = new SoundBank(engine, "Content\\Audio\\Sounds.xsb");
            BackgroundMusic = soundBank.GetCue("478503_PlayfulStrollJoyfulOboeMorganCut");
            Birdsong = soundBank.GetCue("157536__juskiddink__woodland-birdsong-june");

            BackgroundMusic.Play();
            Birdsong.Play();

            Butterfly.ButterflyTextures = new Texture2D[Enum.GetNames(typeof(Butterfly.ButterflyColors)).Length];
            for (int i = 0; i < Butterfly.ButterflyTextures.Length; i++)
            {
                Butterfly.ButterflyTextures[i] = SingleColorTextureCreator.Create(myGame.GraphicsDevice, 256, 256, (Butterfly.ButterflyColors)(i));
            }
            player.LoadContent(content);
            currentLevel.LoadContent(content, myGame.GraphicsDevice.Viewport);

            //debug code
            sb = myGame.Services.GetService(typeof(SpriteBatch)) as SpriteBatch;
        }
開發者ID:rocketeer13,項目名稱:KinderKinect,代碼行數:22,代碼來源:ButterflyActivity.cs

示例13: Initialize

        public override void Initialize()
        {
            audioEngine = new AudioEngine("Content\\InvadersAudio.xgs");
            waveBank = new WaveBank(audioEngine, "Content\\Wave Bank.xwb");
            soundBank = new SoundBank(audioEngine, "Content\\Sound Bank.xsb");

            if (gameSong == null)
            {
                gameSong = soundBank.GetCue("in game");

            }

            if (menuSong == null)
            {
                menuSong = soundBank.GetCue("Menu");

            }

            if (deathSong == null)
            {
                deathSong = soundBank.GetCue("Death");
            }
        }
開發者ID:Dan-Williams93,項目名稱:Computer-Game-Development-Space-Invaders-ish,代碼行數:23,代碼來源:SoundManager.cs

示例14: Initialize

        public override void Initialize()
        {
            base.Initialize();

            m_AudioEngine = new AudioEngine(@"Content\Audio\GameSounds.xgs");
            m_WaveBank = new WaveBank(m_AudioEngine, @"Content\Audio\Wave Bank.xwb");
            m_SoundBank = new SoundBank(m_AudioEngine, @"Content\Audio\Sound Bank.xsb");
            m_MusicCategory = m_AudioEngine.GetCategory("Music");
            m_EffectsCategory = m_AudioEngine.GetCategory("Default");
            // r_Factory.SetSoundBank(m_SoundBank);

            m_Music = m_SoundBank.GetCue("BGMusic");

            m_Music.Play();
        }
開發者ID:rockem,項目名稱:spaceintruders,代碼行數:15,代碼來源:SoundManager.cs

示例15: LoadContent

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

            // Load the XACT data
            audioEngine = new AudioEngine(@"Content\Audio\GameAudio.xgs");
            waveBank = new WaveBank(audioEngine, @"Content\Audio\Wave Bank.xwb");
            soundBank = new SoundBank(audioEngine, @"Content\Audio\Sound Bank.xsb");

            // Start the soundtrack audio
            trackCue = soundBank.GetCue("track");
            trackCue.Play();

            // Play the start sound
            soundBank.PlayCue("start");
        }
開發者ID:mattgmg1990,項目名稱:Computer-Graphics-Final-Project,代碼行數:17,代碼來源:Game1.cs


注:本文中的Microsoft.Xna.Framework.Audio.SoundBank.GetCue方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。