当前位置: 首页>>代码示例>>C#>>正文


C# WaveIn.GetMixerLine方法代码示例

本文整理汇总了C#中NAudio.Wave.WaveIn.GetMixerLine方法的典型用法代码示例。如果您正苦于以下问题:C# WaveIn.GetMixerLine方法的具体用法?C# WaveIn.GetMixerLine怎么用?C# WaveIn.GetMixerLine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NAudio.Wave.WaveIn的用法示例。


在下文中一共展示了WaveIn.GetMixerLine方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: VolumeControl

        public VolumeControl(int deviceNumber)
        {
            waveIn = new WaveIn();
            waveIn.DeviceNumber = deviceNumber;
            //           waveIn.DataAvailable += waveIn_DataAvailable;
            //           waveIn.StartRecording();

            int waveInDeviceNumber = waveIn.DeviceNumber;
            if (Environment.OSVersion.Version.Major >= 6) // Vista and over
            {
                var mixerLine = waveIn.GetMixerLine();
                //new MixerLine((IntPtr)waveInDeviceNumber, 0, MixerFlags.WaveIn);
                foreach (var control in mixerLine.Controls.Where(control => control.ControlType == MixerControlType.Volume))
                {
                    this.volumeControl = control as UnsignedMixerControl;
                    //Level = desiredVolume;
                    break;
                }
            }
            else
            {
                var mixer = new Mixer(waveInDeviceNumber);
                foreach (var source in from destination in mixer.Destinations
                                       where destination.ComponentType == MixerLineComponentType.DestinationWaveIn
                                       from source in destination.Sources
                                       where source.ComponentType == MixerLineComponentType.SourceMicrophone
                                       select source)
                {
                    foreach (var control in source.Controls.Where(control => control.ControlType == MixerControlType.Volume))
                    {
                        volumeControl = control as UnsignedMixerControl;
                        //Level = desiredVolume;
                        break;
                    }
                }
            }
        }
开发者ID:gbanister,项目名称:VolumeControl,代码行数:37,代码来源:VolumeControl.cs

示例2: CanGetWaveInMixerLine

 public void CanGetWaveInMixerLine()
 {
     using (WaveIn waveIn = new WaveIn())
     {
         MixerLine line = waveIn.GetMixerLine();                
         //Debug.WriteLine(String.Format("Mic Level {0}", level));
     }
 }
开发者ID:Punloeu,项目名称:karaoke,代码行数:8,代码来源:MixerApiTests.cs

示例3: Record

        public void Record(string fileName, int volume = 100)
        {
            _waveIn = new WaveIn { WaveFormat = new WaveFormat() };
            _writer = new WaveFileWriter(fileName, _waveIn.WaveFormat);

            TrySetVolumeControl(_waveIn.GetMixerLine(), volume);

            _waveIn.DataAvailable += new_dataAvailable;
            _waveIn.StartRecording();
        }
开发者ID:AdamStefan,项目名称:Speech-Recognition,代码行数:10,代码来源:Recorder.cs

示例4: AudioLevelManager

 protected AudioLevelManager(WaveIn waveDevice)
     : this(GetVolumeMixerControlForInputLine(waveDevice.GetMixerLine()))
 {
 }
开发者ID:stevenzeiler,项目名称:FeenPhone,代码行数:4,代码来源:AudioLevelManager.cs


注:本文中的NAudio.Wave.WaveIn.GetMixerLine方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。