コード例 #1
0
        /// <summary>
        /// Create MicrophoneConstruct object for the the audio device in memory with the "selectedDevice" index.
        /// Wave format of 44.1 khz , stereo.
        /// </summary>
        /// <param ID="selectedDevice"></param>
        public MicrophoneConstruct(int selectedDevice)
        {
            waveIn = new WaveIn();

            if (WaveIn.DeviceCount > 1)
                waveIn.DeviceNumber = selectedDevice;

            waveIn.WaveFormat = new WaveFormat(44100, 2);

            waveIn.DataAvailable += new EventHandler<WaveInEventArgs>(waveIn_DataAvailable);
            waveIn.RecordingStopped += new EventHandler<StoppedEventArgs>(waveIn_RecordingStoped);

            aggregator = new MicrophoneSampleAggregator();
            aggregator.NotificationCount = 10; // How often we update the volume bar value;
        }
コード例 #2
0
        /// <summary>
        /// Create MicrophoneConstruct object for the the audio device in memory with the "selectedDevice" index.
        /// Wave format of 44.1 khz , stereo.
        /// </summary>
        /// <param ID="selectedDevice"></param>
        public MicrophoneConstruct(int selectedDevice)
        {
            waveIn = new WaveIn();

            if (WaveIn.DeviceCount > 1)
            {
                waveIn.DeviceNumber = selectedDevice;
            }

            waveIn.WaveFormat = new WaveFormat(44100, 2);

            waveIn.DataAvailable    += new EventHandler <WaveInEventArgs>(waveIn_DataAvailable);
            waveIn.RecordingStopped += new EventHandler <StoppedEventArgs>(waveIn_RecordingStoped);

            aggregator = new MicrophoneSampleAggregator();
            aggregator.NotificationCount = 10; // How often we update the volume bar value;
        }