예제 #1
0
 public CsCoreEngine()
 {
     using (var enumerator = new MMDeviceEnumerator())
     {
         device = enumerator.GetDefaultAudioEndpoint(DataFlow.Render, Role.Console);
     }
     endpointVolume = AudioEndpointVolume.FromDevice(device);
 }
        public AudioEndpointVolumeChannel(AudioEndpointVolume audioEndpointVolume, int channelIndex)
        {
            if (audioEndpointVolume == null)
                throw new ArgumentNullException("audioEndpointVolume");
            if (channelIndex < 0)
                throw new ArgumentOutOfRangeException("channelIndex");

            _audioEndpointVolume = audioEndpointVolume;
            _channelIndex = channelIndex;
        }
예제 #3
0
        public AudioEndpointVolumeChannel(AudioEndpointVolume audioEndpointVolume, int channelIndex)
        {
            if (audioEndpointVolume == null)
            {
                throw new ArgumentNullException("audioEndpointVolume");
            }
            if (channelIndex < 0)
            {
                throw new ArgumentOutOfRangeException("channelIndex");
            }

            _audioEndpointVolume = audioEndpointVolume;
            _channelIndex        = channelIndex;
        }