当前位置: 首页>>代码示例>>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;未经允许,请勿转载。