/// <summary> /// Tries to retrieve a WAV file from the Wavs dictionary. /// Will load the file from disk, if not yet loaded. /// </summary> /// <param name="File"></param> /// <returns></returns> public Tuple <IntPtr, uint> GetWavFile(string File) { Tuple <IntPtr, uint> wavData = null; // if the file is known if (Wavs.TryGetValue(File, out wavData)) { // haven't loaded it yet? if (wavData == null) { // load it wavData = Util.LoadFileToUnmanagedMem(WavFolder + "/" + File); // update the registry Wavs.TryUpdate(File, wavData, null); } } return(wavData); }
/// <summary> /// Tries to retrieve a WAV file from the Wavs dictionary. /// Will load the file from disk, if not yet loaded. /// </summary> /// <param name="File"></param> /// <returns></returns> public string GetWavFile(string File) { string filename = null; // if the file is known if (Wavs.TryGetValue(File, out filename)) { // haven't loaded it yet? if (filename == null) { // load it filename = Path.Combine(WavFolder, File); // update the registry if (Wavs.TryUpdate(File, filename, null)) { numLoadedWavs++; } } } return(filename); }