Suggestions

close search

Add Messaging, Voice, and Authentication to your apps with Vonage Communications APIs

Visit the Vonage API Developer Portal

OpenTok.AudioDevice.AudioBus

An audio bus used for all publisher and subscribers. This class is used to both read and write audio samples in order for them to be rendered or sent to remote peers. More...

Public Member Functions

int ReadRenderData (IntPtr buffer, int numberOfSamples)
 Reads audio data from subscriber audio streams to be rendered. This function will return immediately and will fill the provided buffer with the number of samples requested or the number of samples available in the internal buffer, whichever is lower. The function will return the actual number of samples copied into the provided buffer, which must be big enough to hold at least the number of samples requested.

Parameters
bufferThe buffer where the audio information will be written.
numberOfSamplesThe number of samples that are requested to be read.
Returns
The number of samples read.
More...
int WriteCaptureData (IntPtr buffer, int numberOfSamples)
 Writes audio data (to publishers) to be captured and sent in the audio stream.

Parameters
bufferThe buffer where the audio information will be read from.
numberOfSamplesThe number of samples that are requested to be sent.
Returns
The number of samples written.
More...

Detailed Description

An audio bus used for all publisher and subscribers. This class is used to both read and write audio samples in order for them to be rendered or sent to remote peers.

Member Function Documentation

◆ ReadRenderData()

int OpenTok.AudioDevice.AudioBus.ReadRenderData ( IntPtr  buffer,
int  numberOfSamples 
)

Reads audio data from subscriber audio streams to be rendered. This function will return immediately and will fill the provided buffer with the number of samples requested or the number of samples available in the internal buffer, whichever is lower. The function will return the actual number of samples copied into the provided buffer, which must be big enough to hold at least the number of samples requested.

Parameters
bufferThe buffer where the audio information will be written.
numberOfSamplesThe number of samples that are requested to be read.
Returns
The number of samples read.

◆ WriteCaptureData()

int OpenTok.AudioDevice.AudioBus.WriteCaptureData ( IntPtr  buffer,
int  numberOfSamples 
)

Writes audio data (to publishers) to be captured and sent in the audio stream.

Parameters
bufferThe buffer where the audio information will be read from.
numberOfSamplesThe number of samples that are requested to be sent.
Returns
The number of samples written.