public frmAudioSettings(AudioCapability ac, frmAVDevices frmAV) { InitializeComponent(); Debug.Assert(ac != null); Debug.Assert(ac.AudioCaptureGraph != null); Debug.Assert(frmAV != null); this.ac = ac; this.acg = ac.AudioCaptureGraph; this.frmAV = frmAV; }
/// <summary> /// Creates the actual FilgraphManager with the chosen microphone /// </summary> private void CreateAudioGraph(FilterInfo fi) { Debug.Assert(cg == null); if (DVSource.IsDVSourceWithAudio(fi)) { cg = DVCaptureGraph.GetInstance(fi); Log(((DVCaptureGraph)cg).DVSource.Dump()); } else { // Create the graph, which creates the source filter cg = new AudioCaptureGraph(fi); Log(((AudioCaptureGraph)cg).AudioSource.Dump()); } }
/// <summary> /// Creates the actual FilgraphManager with the chosen microphone /// </summary> private void CreateAudioGraph(FilterInfo fi) { Debug.Assert(acg == null); // Create the graph, which creates the source filter cg = new AudioCaptureGraph(fi); Log(acg.AudioSource.Dump()); }
public void RenderAndRunAudio(AudioCaptureGraph acg) { RenderAndRunAudio(acg, ckPlayAudio.Checked); }
private void DeactivateAudioCapability() { RenderAndRunAudio(acg, false); acg = null; ac.DeactivateMicrophone(); }
private void ActivateAudioCapability(FilterInfo fi) { ac = new AudioCapability(fi); ac.SetLogger(new AVLogger(Log)); ac.ActivateMicrophone(); acg = ac.AudioCaptureGraph; RenderAndRunAudio(acg, ckPlayAudio.Checked); }
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)); }