本文整理汇总了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());
}
}
示例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"));
}
示例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);
}
示例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");
}
示例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);
}
示例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);
}
示例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();
}
示例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
}
示例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");
}
示例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);
}
示例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);
}
示例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);
}
示例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");
}
示例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;
}
示例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();
}