private void SetupAudioStream(AudioStreamSettings settings)
        {
            logger.Debug("StartAudioStream(...)");

            if (audioStreamer != null)
            {
                audioStreamer.StateChanged -= AudioStreamer_StateChanged;
            }

            try
            {
                audioStreamer = new AudioStreamer(audioSource);
                audioStreamer.Setup(audioSettings.EncodingParams, audioSettings.NetworkParams);
                audioStreamer.StateChanged += AudioStreamer_StateChanged;
            }
            catch (Exception ex)
            {
                logger.Error(ex);
                if (audioStreamer != null)
                {
                    audioStreamer.Close();
                    audioStreamer.StateChanged -= AudioStreamer_StateChanged;
                    audioStreamer = null;
                }

                throw;
            }
        }
 private void StopAudioStream()
 {
     if (audioStreamer != null)
     {
         //audioStreamer.SetWaveformPainter(null);
         audioStreamer.Close();
     }
 }
Пример #3
0
        private void audioStopButton_Click(object sender, EventArgs e)
        {
            logger.Debug("audioStopButton_Click(...)");

            if (audioStreamer != null)
            {
                //udioStreamer.SetWaveformPainter(null);
                audioStreamer.Close();
            }
        }