Delegate CoreAudioCaptureDataAvailableHandler
Provides an event handler that provides the audio data captured by a CoreAudioCapture instance.
public delegate void CoreAudioCaptureDataAvailableHandler(ReadOnlySpan<byte> audioData, double currentTimeInSeconds, double firstByteAcquiredFromHALTimeInSeconds)
Parameters
audioDataReadOnlySpan<byte>The span of bytes containing the capture data.
currentTimeInSecondsdoubleA HAL timestamp, in seconds, that indicate when the HAL started the I/O cycle.
firstByteAcquiredFromHALTimeInSecondsdoubleA HAL timestamp, in seconds, that indicate when the first byte of the currently provided audio data was retrieved.
Remarks
Note that the audioData parameter points to an arbitrary memory block
provided by the HAL so that it's clients can retrieve the audio data from the
hardware device; as such, just assigning the span to a field will later on cause
memory corruption issues. So, provide your own allocated buffer and copy
the data that the audioData parameter contains to
your own buffer before the execution of the method reaches it's end.