Esempio n. 1
0
 private void PublishBuffer()
 {
     if (_waveBufferPos > 64000 * 1.5) //if less then 1.5 seconds, don't publish
     {
         _logger.LogInformation("Kinect published audio.");
         byte[] convertedWave = AudioSample.ConvertFormat32fTO16int(_waveBuffer, _waveBufferPos, 1);
         SampleReady?.Invoke(this, new AudioSample(DateTime.Now, convertedWave, convertedWave.Length, new AudioSample.FixedWaveFormat(16000)));
         _waveBufferPos = 0;
     }
 }