Event DataCaptured
- Namespace
- DotNetBrowser.Media
- Assembly
- DotNetBrowser.dll
Occurs when a buffer of audio has been captured.
event EventHandler<AudioDataCapturedEventArgs> DataCaptured
Returns
- EventHandler<AudioDataCapturedEventArgs>
- Occurs when a buffer of audio has been captured.
Remarks
The buffers are delivered one by one, in the order they were captured, on a dedicated thread. Keep the handler fast: the buffers that wait for delivery are kept in memory.
Stop() and Dispose() wait up to three seconds for the running handler to return. A handler that runs longer may still be running after they return, so if it uses resources that you release after stopping the session, synchronize the handler with that code.
Don't marshal from the handler synchronously to the thread that stops the session, for example
with Dispatcher.Invoke or Control.Invoke: the wait then always takes the full three
seconds. Use the asynchronous counterparts such as Dispatcher.InvokeAsync or
Control.BeginInvoke.
The buffers captured before the handler is added are not delivered to it.