public void PlaySound(DriveSound soundToPlay) { Stop(); _sound = soundToPlay; _sound.PlaySound(_channel1); }
public DriveSound AddSound(string fileName, float pitch, float volume, bool looped, float loopFadeTime) { // Adds a new sound with all attributes manually set DriveSound newSound = new DriveSound(fileName, pitch, volume, looped, loopFadeTime); _clips.Add(newSound); return newSound; }
public DriveSound AddSound(string fileName) { // Adds a sound set to standard pitch and volume (= 1.0f) and looped to true DriveSound newSound = new DriveSound(fileName); _clips.Add(newSound); return newSound; }
// Adds a new sound with pitch = 1.0f, volume = 1.0f and looped = false public void AddSound(string fileName) { DriveSound newSound = new DriveSound(fileName); newSound.IsLooped = false; _sounds.Add(newSound); }
public void Stop() { _channel1.Stop(); _channel2.Stop(); _sound = null; }
public void LoadSounds(SmoothSoundManager soundManager) { _soundManager = soundManager; // Load all Sounds into the sound manager _engineSound = _soundManager.AddSound(CarEngineSounds.CarDrive.ToString(), 1.0f, 1.0f, true, 1f); _soundManager.AddSound(CarEngineSounds.CarStart.ToString(), 1.0f, 1.0f, false, 0); _soundManager.AddSound(CarEngineSounds.CarStop.ToString(), 1.0f, 1.0f, false, 0.5f); _gasSound = _soundManager.AddSound(CarEngineSounds.CarGas.ToString(), 1.0f, 1.0f, true, 0.6f); }
// Adds a new sound public void AddSound(string fileName, float pitch, float volume, bool looped) { DriveSound newSound = new DriveSound(fileName, pitch, volume, looped, 0); _sounds.Add(newSound); }