/// <summary> /// Returns the name of the sound based on either the internal reference or the sound back definitions /// </summary> /// <param name="soundId">The id index of the sound</param> /// <param name="soundBank">The sound bank in which to look</param> /// <param name="soundType">The emission type</param> /// <returns>The name of the sound</returns> private string GetSoundString(int soundId, EffSndBnk soundBank, ref EmissionType soundType) { if (soundId == 0) { return(""); } // Emit sounds if (soundId >= 1 && soundId < 32 && soundId < soundBank.EmitSounds.Count) { soundType = EmissionType.Emit; return(soundBank.EmitSounds[soundId - 1]); } // Hardcoded client sounds if (soundId >= 32 && soundId < 162) { soundType = EmissionType.Internal; if (soundId == 39) { return("death_me"); } if (soundId == 143) { return("thunder1"); } if (soundId == 144) { return("thunder2"); } if (soundId == 158) { return("wind_lp1"); } if (soundId == 159) { return("rainloop"); } if (soundId == 160) { return("torch_lp"); } if (soundId == 161) { return("watundlp"); } } // Loop sounds if (soundId >= 162 && soundId < 162 + soundBank.LoopSounds.Count) { soundType = EmissionType.Loop; return(soundBank.LoopSounds[soundId - 161 - 1]); } return(""); }
/// <summary> /// Sets the path and sound bank reference /// </summary> /// <param name="soundFilePath">The OS path</param> /// <param name="soundBank">A reference to the sound bank</param> public EffSounds(string soundFilePath, EffSndBnk soundBank) { _soundFilePath = soundFilePath; _soundBank = soundBank; }