CEngineSharp_Client.Audio.SfxManager.LoadSounds C# (CSharp) Method

LoadSounds() public method

public LoadSounds ( string soundFilePath ) : void
soundFilePath string
return void
        public void LoadSounds(string soundFilePath)
        {
            var dI = new DirectoryInfo(soundFilePath);

            if (_sounds == null)
                _sounds = new Dictionary<string, SoundBuffer>();
            else
                _sounds.Clear();

            Console.WriteLine(@"Loading sound effects.");

            foreach (var file in dI.GetFiles("*.ogg", SearchOption.AllDirectories))
            {
                _sounds.Add(file.Name.Remove(file.Name.Length - 4, 4), new SoundBuffer(file.FullName));
            }

            Console.WriteLine(@"Loaded {0} sound effect(s).", _sounds.Count);
        }