Пример #1
0
 protected virtual void OnVideoEncoded(IFile fileToEncode)
 {
     OnEncoded?.Invoke(this, new EventArgs <IFile>()
     {
         Data = fileToEncode
     });
 }
 void OnAudioReady(float[] data)
 {
     foreach (var sample in data)
     {
         pcmQueue.Enqueue(sample);
     }
     while (pcmQueue.Count > frameSize)
     {
         for (int i = 0; i < frameSize; i++)
         {
             frameBuffer[i] = pcmQueue.Dequeue();
         }
         var encodedLength = encoder.Encode(frameBuffer, outputBuffer);
         OnEncoded?.Invoke(outputBuffer, encodedLength);
     }
 }