當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。