public void PlaySound(string fileName) { var input = new AudioFileReader(fileName); CachedSound cachedSound = null; if (!cachedSounds.TryGetValue(fileName, out cachedSound)) { cachedSound = new CachedSound(fileName); cachedSounds.Add(fileName, cachedSound); } PlaySound(cachedSound); }
public void PlaySound(string fileName, float volume = 1) { var input = new AudioFileReader(fileName); CachedSound cachedSound = null; if (!cachedSounds.TryGetValue(fileName, out cachedSound)) { cachedSound = new CachedSound(fileName); cachedSounds.Add(fileName, cachedSound); } var resultingSampleProvider = new VolumeSampleProvider(new CachedSoundSampleProvider(cachedSound)); resultingSampleProvider.Volume = volume; AddMixerInput(resultingSampleProvider); }
public CachedSoundSampleProvider(CachedSound cachedSound) { this.cachedSound = cachedSound; }
public void PlaySound(CachedSound sound) { AddMixerInput(new CachedSoundSampleProvider(sound)); }