java.lang.Object

com.opentok.android.AudioData


public class AudioData extends Object

Defines audio data passed into the PublisherKit.CustomAudioTransformer.transform() method.

Constructor Summary

Constructors

Constructor

Description

AudioData(long sampleBufferPtr, int bitsPerSample, int sampleRate, int numberOfChannels, int numberOfSamples)

Method Summary

All MethodsInstance MethodsConcrete Methods

Modifier and Type

Method

Description

int

getBitsPerSample()

The number of bits in each sample.

int

getNumberOfChannels()

The number of audio channels.

int

getNumberOfSamples()

The number of samples.

ByteBuffer

getSampleBuffer()

The buffer with the audio samples.

int

getSampleRate()

The bitrate of the samples, in bits per second.

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Details

AudioData

public AudioData(long sampleBufferPtr, int bitsPerSample, int sampleRate, int numberOfChannels, int numberOfSamples)

Method Details

getSampleBuffer

public ByteBuffer getSampleBuffer()

The buffer with the audio samples. The total size of the buffer is NumberOfSamples * NumberOfChannels * BitsPerSample / 8. Inside the buffer, the data is organized one sample after the other, where each sample contains all channels, one after the other. For a batch of stereo audio, the buffer looks like this: S1C1 S1C2 S2C1 S2C2 ...

getBitsPerSample

public int getBitsPerSample()

The number of bits in each sample.

getSampleRate

public int getSampleRate()

The bitrate of the samples, in bits per second.

getNumberOfChannels

public int getNumberOfChannels()

The number of audio channels.

getNumberOfSamples

public int getNumberOfSamples()

The number of samples.