AudioData

public class AudioData

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

Methods

Name Description
AudioData(sampleBufferPtr, bitsPerSample, sampleRate, numberOfChannels, numberOfSamples)
getBitsPerSample() → {int} The number of bits in each sample.
getNumberOfChannels() → {int} The number of audio channels.
getNumberOfSamples() → {int} The number of samples.
getSampleBuffer() → {ByteBuffer} The buffer with the audio samples.
getSampleRate() → {int} The bitrate of the samples, in bits per second.

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

Parameters:
Name Type Description
sampleBufferPtr long
bitsPerSample int
sampleRate int
numberOfChannels int
numberOfSamples int

getBitsPerSample() → {int}

The number of bits in each sample.

Returns:

int

getNumberOfChannels() → {int}

The number of audio channels.

Returns:

int

getNumberOfSamples() → {int}

The number of samples.

Returns:

int

getSampleBuffer() → {ByteBuffer}

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

Returns:

ByteBuffer

getSampleRate() → {int}

The bitrate of the samples, in bits per second.

Returns:

int