public static async Task <ISampleProvider> PlaySound(this MixingSampleProvider mixer, string path, float volume, float balance) { var sound = await CachedSound.GetOrCreateCacheSound(path).ConfigureAwait(false); PlaySound(mixer, sound, volume, balance, out var rootSample); return(rootSample); }
public static async Task <ISampleProvider> PlaySound(this MixingSampleProvider mixer, string path, SampleControl sampleControl) { var sound = await CachedSound.GetOrCreateCacheSound(path).ConfigureAwait(false); PlaySound(mixer, sound, sampleControl, out var rootSample); return(rootSample); }
internal async Task <CachedSound> GetCachedSoundAsync() { if (_cachedSound != null) { return(_cachedSound); } var result = await CachedSound.GetOrCreateCacheSound(FilePath).ConfigureAwait(false); _cachedSound = result; return(result); }