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


C# AudioEngine.GetCategory方法代码示例

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


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

示例1: Load

        public override void Load()
        {
            try
            {
                m_AudioEngine = new AudioEngine(m_RootDirectory + "sounds.xgs");

                if (m_AudioEngine != null)
                {
                    m_WaveBank = new WaveBank(m_AudioEngine, (m_RootDirectory + "Wave Bank.xwb"));
                    m_SoundBank = new SoundBank(m_AudioEngine, (m_RootDirectory + "Sound Bank.xsb"));

                    // Get sound categories
                    AudioCategory soundCategory = m_AudioEngine.GetCategory("Sounds");
                    AudioCategory musicCategory = m_AudioEngine.GetCategory("Music");

                    // Set into the custom categories
                    m_SoundCategory = new CustomAudioCategory(soundCategory);
                    m_MusicCategory = new CustomAudioCategory(musicCategory);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
            }
        }
开发者ID:Imortilize,项目名称:Psynergy-Engine,代码行数:25,代码来源:XACTEngine.cs

示例2: LoadContent

 public void LoadContent(string path)
 {
     engine = new AudioEngine(path + "sounds.xgs");
     sounds = new SoundBank(engine, path + "Sound Bank.xsb");
     waves = new WaveBank(engine, path + "Wave Bank.xwb");
     categories = new Dictionary<string, AudioCategory>();
     categories.Add("Music", engine.GetCategory("Music"));
     categories.Add("Default", engine.GetCategory("Default"));
 }
开发者ID:eriksk,项目名称:Ludum-Dare-48,代码行数:9,代码来源:AudioManager.cs

示例3: SoundManager

        private SoundManager()
        {
            AudioEngine = new AudioEngine(@"Content/Sound/Sound.xgs");
            WaveBank = new WaveBank(AudioEngine, @"Content/Sound/Wave Bank.xwb");
            SoundBank = new SoundBank(AudioEngine, @"Content/Sound/Sound Bank.xsb");

            // ボリュームの設定
            AudioEngine.GetCategory("BGM").SetVolume(0.8f);
            AudioEngine.GetCategory("SE").SetVolume(1.0f);
        }
开发者ID:hirama-akihiro,项目名称:MazeEscaper,代码行数:10,代码来源:SoundManager.cs

示例4: Audio

        static Audio()
        {
            //Ladda in ljud-resurser
            audioEngine = new AudioEngine("Content/Audio/sounds.xgs");
            waveBank = new WaveBank(audioEngine, "Content/Audio/Wave Bank.xwb");
            soundBank = new SoundBank(audioEngine, "Content/Audio/Sound Bank.xsb");

            //Kategori på ljud i xact-projektet
            music = audioEngine.GetCategory("Music");
            soundEffects = audioEngine.GetCategory("Sound Effects");
        }
开发者ID:km222ew,项目名称:Break-a-Brick,代码行数:11,代码来源:Audio.cs

示例5: SoundEngine

        /// <summary>
        /// Private constructor as per the Singleton pattern which reads the
        /// compiled sound files into memory.
        /// </summary>
        private SoundEngine()
        {
            // These files are automatically created in the output directory
            //  matching the relative path of wherever the .xap file is located
            m_audio = new AudioEngine(@"Content\Audio\sounds.xgs");
            m_waveBank = new WaveBank(m_audio,@"Content\Audio\waves1.xwb");
            m_soundBank = new SoundBank(m_audio,@"Content\Audio\sounds1.xsb");

            AudioCategory music = m_audio.GetCategory("Music");
            music.SetVolume(1f);
            AudioCategory effects = m_audio.GetCategory("Effect");
            effects.SetVolume(1f);
        }
开发者ID:BNHeadrick,项目名称:Bros,代码行数:17,代码来源:SoundEngine.cs

示例6: AudioController

        /// <summary>
        /// AudioController Constructor.
        /// Initializes AudioEngine, SoundBank and WaveBank.
        /// </summary>
        private AudioController()
        {
            String path = System.Environment.CurrentDirectory;
            path = path.Replace(@"\bin\Debug", @"\Resources");

            audioEngine = new AudioEngine(path + @"\sound.xgs");
            WaveBank = new WaveBank(audioEngine, path + @"\Wave Bank.xwb");
            SoundBank = new SoundBank(audioEngine, path + @"\Sound Bank.xsb");

            NoteCategory = audioEngine.GetCategory("Notes");
            NoteCategory.SetVolume(3.0f);
            AudioCategory BackgroundCategory = audioEngine.GetCategory("Background sound");
            BackgroundCategory.SetVolume(2.0f);
        }
开发者ID:Acemond,项目名称:PopNTouch,代码行数:18,代码来源:AudioController.cs

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

示例8: Sound

        /// <summary>
        /// Create sound
        /// </summary>
        static Sound()
        {
            try
            {
                string dir = Directories.SoundsDirectory;
                audioEngine = new AudioEngine(
                    Path.Combine(dir, "XnaShooter.xgs"));
                waveBank = new WaveBank(audioEngine,
                    Path.Combine(dir, "Wave Bank.xwb"));

                // Dummy wavebank call to get rid of the warning that waveBank is
                // never used (well it is used, but only inside of XNA).
                if (waveBank != null)
                    soundBank = new SoundBank(audioEngine,
                        Path.Combine(dir, "Sound Bank.xsb"));

                // Get the music category to change the music volume and stop music
                musicCategory = audioEngine.GetCategory("Music");
            } // try
            catch (Exception ex)
            {
                // Audio creation crashes in early xna versions, log it and ignore it!
                Log.Write("Failed to create sound class: " + ex.ToString());
            } // catch
        }
开发者ID:kiichi7,项目名称:XnaShooter,代码行数:28,代码来源:Sound.cs

示例9: ScreenManager

 public ScreenManager(Game game)
     : base(game)
 {
     // Start background music
     audioEngine = new AudioEngine(@"Content\Audio\boardClickSound.xgs");
     soundBank = new SoundBank(audioEngine, @"Content\Audio\Sound Bank.xsb");
     waveBank = new WaveBank(audioEngine, @"Content\Audio\Wave Bank.xwb");
     audioCategory = audioEngine.GetCategory("background");
 }
开发者ID:deshpr,项目名称:TicTacToeGame,代码行数:9,代码来源:ScreenManager.cs

示例10: AudioManager

 public AudioManager(Game1 currentGame)
 {
     game = currentGame;
     engine = new AudioEngine("Content\\SFX\\SFX.xgs");
     soundBank = new SoundBank(engine, "Content\\SFX\\Sound Bank.xsb");
     waveBank = new WaveBank(engine, "Content\\SFX\\Wave Bank.xwb");
     fxCat = engine.GetCategory("SFX");
     fxCat.SetVolume(10f);
 }
开发者ID:RandyRhombus,项目名称:Titans1,代码行数:9,代码来源:AudioManager.cs

示例11: AudioManager

        public AudioManager()
        {
            engine = new AudioEngine("Content/Sound/XACT Sound File.xgs");
            waves = new WaveBank(engine, "Content/Sound/Wave Bank.xwb");
            sounds = new SoundBank(engine, "Content/Sound/Sound Bank.xsb");

            soundEffectCategory = engine.GetCategory("Sound Effect");
            soundEffectCategory.SetVolume(sfxVolume);

            backgroundMusicCategory = engine.GetCategory("Music");
            backgroundMusicCategory.SetVolume(backgroundVolume);

            //the default gun sound was much too loud, so I created its own category to set the
            //volume for only that sound
            gunshotCategory = engine.GetCategory("Gunshot");
            gunshotCategory.SetVolume(gunshotVolume);

            Cue startSplashMusic = sounds.GetCue("Drum n Bass D Coexistant");
            playFirstBackgroundMusic(startSplashMusic);
        }
开发者ID:Bacon41,项目名称:PantheonPrototype,代码行数:20,代码来源:AudioManager.cs

示例12: MusicManager

        public MusicManager(float lightThreshold, float darkThreshold)
        {
            LightThreshold = lightThreshold;
              DarkThreshold = darkThreshold;

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

              light = audioEngine.GetCategory("Light");
              dark = audioEngine.GetCategory("Dark");
              light2 = audioEngine.GetCategory("Light2");
              dark2 = audioEngine.GetCategory("Dark2");

              CurrentStage = 0;
              NextStage = 0;
              light.SetVolume(0.0f);
              dark.SetVolume(0.0f);
              light2.SetVolume(0.0f);
              dark2.SetVolume(0.0f);
        }
开发者ID:northdocks,项目名称:ggj-2011-tree-of-light,代码行数:21,代码来源:MusicManager.cs

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

示例14: AudioPlayer

        public AudioPlayer(ContentManager content)
        {
            engine = new AudioEngine("Content/Sounds/RecellectionSounds.xgs");
            waves = new WaveBank(engine, "Content/Sounds/Wave Bank.xwb");
            sounds = new SoundBank(engine, "Content/Sounds/Sound Bank.xsb");
            soundCategory = engine.GetCategory("Default");

            soundVolume = 1.0f;
            songs = new Song[1];
            songs[0] = content.Load<Song>("Sounds/Songs/Castlevania");

            MediaPlayer.IsMuted = true;
        }
开发者ID:squid-box,项目名称:Breensoft-ReCellection,代码行数:13,代码来源:AudioPlayer.cs

示例15: SoundManager

        private SoundManager(Game game, Func<Vector3> getListenerPosition, Func<Vector3> getListenerForward, Func<Vector3> getListenerUp)
            : base(game)
        {
            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");
            musicCategory = audioEngine.GetCategory("Default");
            volume = 10;
            musicCategory.SetVolume(volume);

            cuelist = new List<Cue>();
            BGMCuelist = new List<Cue>();

            updateListenerForward = getListenerForward;
            updateListenerUp = getListenerUp;
            updateListenerPosition = getListenerPosition;
            listener = new AudioListener();
        }
开发者ID:kozupi,项目名称:--,代码行数:18,代码来源:SoundManager.cs


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