Package com.opentok.android
Class AudioData
java.lang.Object
com.opentok.android.AudioData
Defines audio data passed into the PublisherKit.CustomAudioTransformer.transform()
method.
-
Constructor Summary
ConstructorsConstructorDescriptionAudioData
(long sampleBufferPtr, int bitsPerSample, int sampleRate, int numberOfChannels, int numberOfSamples) -
Method Summary
Modifier and TypeMethodDescriptionint
The number of bits in each sample.int
The number of audio channels.int
The number of samples.The buffer with the audio samples.int
The bitrate of the samples, in bits per second.
-
Constructor Details
-
AudioData
public AudioData(long sampleBufferPtr, int bitsPerSample, int sampleRate, int numberOfChannels, int numberOfSamples)
-
-
Method Details
-
getSampleBuffer
The buffer with the audio samples. The total size of the buffer isNumberOfSamples * 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.
-