Package com.opentok.android
Class AudioData
- java.lang.Object
-
- com.opentok.android.AudioData
-
public class AudioData extends java.lang.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 Methods Instance Methods Concrete 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.java.nio.ByteBuffer
getSampleBuffer()
The buffer with the audio samples.int
getSampleRate()
The bitrate of the samples, in bits per second.
-
-
-
Method Detail
-
getSampleBuffer
public java.nio.ByteBuffer 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.
-
-