Esempio n. 1
0
        public void RenderAndRunAudio(AudioCaptureGraph acg, bool playIt)
        {
            if(acg == null)
            {
                throw new ArgumentNullException("Can't render an audio graph without an audio capture device");
            }

            if(playIt)
            {
                Log("Playing audio (render and run graph) - " + acg.Source.FriendlyName);

                // Re-add the renderer in case they changed it since the last
                // time they played the audio
                acg.AddRenderer((FilterInfo)cboSpeakers.SelectedItem);

                acg.Run();
            }
            else
            {
                Log("Stop audio (stop and unrender graph) - " + acg.Source.FriendlyName);

                acg.Stop();
                acg.RemoveRenderer();
            }

            Log(FilterGraph.Debug(acg.IFilterGraph));
        }