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.

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. This function blocks until the buffer is filled.
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.

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. This function blocks until the buffer is filled.

To maintain audio and video synchronization, this function returns the audio information to be renderer at the time of calling it. Take this into consideration if you call this function at a higher rate than the sampling rate. If you request one second of audio, it will return one second of audio unless there is an error.

◆ 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.