private void PlayAsyncInternal() { Task.Run(async() => { var playMe = await ReadyToPlay.Task; if (playMe) { AudioLayer.SourcePlay(SoundInstance.Source); } }); }
protected virtual void PlayInternal() { switch (State) { case PlayState.Playing: break; case PlayState.Paused: AudioLayer.SourcePlay(SoundInstance.Source); break; case PlayState.Stopped: Ended.TrySetResult(false); Ended = new TaskCompletionSource <bool>(); PlayAsyncInternal(); break; } PlayingQueued = false; State = PlayState.Playing; }