Beispiel #1
0
 private void PlayAsyncInternal()
 {
     Task.Run(async() =>
     {
         var playMe = await ReadyToPlay.Task;
         if (playMe)
         {
             AudioLayer.SourcePlay(SoundInstance.Source);
         }
     });
 }
Beispiel #2
0
        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;
        }