Class ModFolderSoundSource
Enables loading sounds from a folder by the name of each sound file, EXCLUDING extensions.
public class ModFolderSoundSource : CustomSoundSourceBase
- Inheritance
-
ModFolderSoundSource
- Inherited Members
- Extension Methods
Constructors
ModFolderSoundSource(string, Assembly)
Enables an FModSoundBuilder to load its sounds from the given folder path inside the mod directory.
public ModFolderSoundSource(string soundFileFolder, Assembly overrideAssembly = null)
Parameters
soundFileFolder
string- The name of or path to the folder that contains the sound files.
Relative to the mod folder (the folder containing
overrideAssembly
). overrideAssembly
Assembly- The assembly of the mod, used for locating the mod folder. If left null, this is automatically resolved to the calling assembly. Using a cached reference can be slightly more performant.
Remarks
Recursive folder structures are not supported.
Methods
InitializeCachedSounds()
Gets all files in the folder and caches their names.
protected override Dictionary<string, CustomSoundSourceBase.CachedSound> InitializeCachedSounds()
Returns
- Dictionary<string, CustomSoundSourceBase.CachedSound>
- A list of all sound names from the folder.