Monitoring - Axwabo/SecretLabNAudio GitHub Wiki

Monitoring Audio Output

Implement the IAudioPacketMonitor interface to monitor the output of an audio player

It defines two methods:

  • OnRead(ReadOnlySpan<float>) - when at least 1 sample was read
  • OnEmpty() - when no samples were read

The buffer's length is the amount of samples that were read, you can operate on the whole span.

Output monitoring is independent of the sample provider. It can be used e.g. for visualizing audio

The monitor is not affected by MasterAmplification

Note

The ReadOnlySpan struct can be found in mscorlib.dll (server assemblies). Add <DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences> to your csproj and reference it.

⚠️ **GitHub.com Fallback** ⚠️