public void PlaySound(int soundIndex, AudioEffects effect = AudioEffects.None, float volume = 1.0f, bool spamCheck = false) { if (volume < 0.01f) { return; } if (Settings.Audio.SoundOn) { ASound sound; if (m_Sounds.TryGetValue(soundIndex, out sound)) { sound.Play(true, effect, volume, spamCheck); } else { string name; byte[] data; if (SoundData.TryGetSoundData(soundIndex, out data, out name)) { sound = new UOSound(name, data); m_Sounds.Add(soundIndex, sound); sound.Play(true, effect, volume, spamCheck); } } } }
public void PlaySound(int soundIndex) { if (Settings.Audio.SoundOn) { ASound sound; if (m_Sounds.TryGetValue(soundIndex, out sound)) { sound.Play(); } else { string name; byte[] data; if (SoundData.TryGetSoundData(soundIndex, out data, out name)) { sound = new UOSound(name, data); m_Sounds.Add(soundIndex, sound); sound.Play(); } } } }
public void PlaySound(int soundIndex, AudioEffects effect = AudioEffects.None, float volume = 1.0f) { if (volume < 0.01f) return; if (Settings.Audio.SoundOn) { ASound sound; if (m_Sounds.TryGetValue(soundIndex, out sound)) { sound.Play(true, effect, volume); } else { string name; byte[] data; if (SoundData.TryGetSoundData(soundIndex, out data, out name)) { sound = new UOSound(name, data); m_Sounds.Add(soundIndex, sound); sound.Play(true, effect, volume); } } } }
public void PlaySound(int soundIndex) { UOSound sound; if (m_Sounds.TryGetValue(soundIndex, out sound)) { if (sound.Status == SoundState.Loaded) sound.Play(); } else { sound = new UOSound(); m_Sounds.Add(soundIndex, sound); string name; byte[] data; if (SoundData.TryGetSoundData(soundIndex, out data, out name)) { sound.Name = name; sound.WaveBuffer = data; sound.Status = SoundState.Loaded; sound.Play(); } } }