Base structure.
Called on the UI or audio stream thread when an error occurred. During the stream creation phase this callback will be called on the UI thread while in the capturing phase it will be called on the audio stream thread. The stream will be stopped immediately.
Called on the audio stream thread when a PCM packet is received for the stream. |data| is an array representing the raw PCM data as a floating point type, i.e. 4-byte value(s). |frames| is the number of frames in the PCM packet. |pts| is the presentation timestamp (in milliseconds since the Unix Epoch) and represents the time at which the decompressed packet should be presented to the user. Based on |frames| and the |channel_layout| value passed to OnAudioStreamStarted you can calculate the size of the |data| array in bytes.
same browser. |params| contains the audio parameters like sample rate and channel layout. |channels| is the number of channels.
Called on the UI thread when the stream has stopped. OnAudioSteamStopped will always be called after OnAudioStreamStarted; both functions may be called multiple times for the same stream.
Implement this structure to handle audio events.