private async Task StopAudioStream()
        {
            if (AudioSource != null)
            {
                DoStopAudioStream();
                await AudioSource.Stop();

                AudioSource.Destroy();
                AudioSource = null;
            }
            if (AudioDepacketizer != null)
            {
                AudioDepacketizer.Destroy();
                AudioDepacketizer = null;
            }
            if (AudioDecoder != null)
            {
                AudioDecoder.Destroy();
                AudioDecoder = null;
            }
            if (ResetAudioPipe != null)
            {
                ResetAudioPipe.Destroy();
                ResetAudioPipe = null;
            }
            if (AudioConverter != null)
            {
                AudioConverter.Destroy();
                AudioConverter = null;
            }
            if (AudioEncoder != null)
            {
                AudioEncoder.Destroy();
                AudioEncoder = null;
            }
            if (AudioPacketizer != null)
            {
                AudioPacketizer.Destroy();
                AudioPacketizer = null;
            }
        }
 private Task StopAudioStream()
 {
     if (AudioDepacketizer != null)
     {
         AudioDepacketizer.Destroy();
         AudioDepacketizer = null;
     }
     if (AudioDecoder != null)
     {
         AudioDecoder.Destroy();
         AudioDecoder = null;
     }
     if (AudioConverter != null)
     {
         AudioConverter.Destroy();
         AudioConverter = null;
     }
     if (ResetAudioPipe != null)
     {
         ResetAudioPipe.Destroy();
         ResetAudioPipe = null;
     }
     if (AudioEncoder != null)
     {
         AudioEncoder.Destroy();
         AudioEncoder = null;
     }
     if (AudioPacketizer != null)
     {
         AudioPacketizer.Destroy();
         AudioPacketizer = null;
     }
     if (AudioSink != null)
     {
         AudioSink.Destroy();
         AudioSink = null;
     }
     return(Task.CompletedTask);
 }