none
There is Too much noise In MS Kinect V2 Audio RRS feed

  • Question

  • Hi

    I am getting too much noise How Can I eliminate the noise

    private KinectSensor sensor;
    private AudioBeamFrameReader audioReader;
    private byte[] audioFrameData;

     public MainWindow()
            {
                InitializeComponent();
                this.Loaded += MainWindow_Loaded;
            }

     void MainWindow_Loaded(object sender, RoutedEventArgs e)
            {

                CustomStart();
                sensor = KinectSensor.GetDefault();
                audioReader = sensor.AudioSource.OpenReader();
                audioFrameData = new byte[sensor.AudioSource.SubFrameLengthInBytes];
                
                sensor.Open();
                audioReader.FrameArrived +=audioReader_FrameArrived;
            }

    void audioReader_FrameArrived(object sender, AudioBeamFrameArrivedEventArgs args)
            {
                using (var audioFrames = args.FrameReference.AcquireBeamFrames())
                {
                    if (audioFrames == null)
                    {
                        return;
                    }

                    var subFrame = audioFrames[0].SubFrames[0];
                    subFrame.CopyFrameDataToArray(audioFrameData);
                    
                    if (this.bufferedWaveProvider == null)          
                        return;
                    
                    this.bufferedWaveProvider.AddSamples(audioFrameData, 0, audioFrameData.Length);
                }
            }

     private void CustomStart()
            {
                for (int i = 0; i < WaveOut.DeviceCount; i++)
                {
                    if (WaveOut.GetCapabilities(i).ProductName.ToLower().StartsWith("Speakers and Headphones".ToLower()))
                    {
                        this.waveOutDevice = new WaveOut { DeviceNumber = i };
                        break;
                    }
                }
                if (this.waveOutDevice == null)
                {
                    this.waveOutDevice = new WaveOut();
                }
                this.bufferedWaveProvider =
                    new BufferedWaveProvider(
                        new WaveFormat(16000,16, 1));
                this.waveOutDevice.Init(this.bufferedWaveProvider);
                this.waveOutDevice.Play();

            }

    I am getting To much Noise.

    Regards,

    Thursday, July 2, 2015 12:53 PM