Class AudioData

  • public class AudioData
    extends java.lang.Object
    Defines audio data passed into the PublisherKit.CustomAudioTransformer.transform() method.
    • Constructor Summary

      Constructor Description
      AudioData​(long sampleBufferPtr, int bitsPerSample, int sampleRate, int numberOfChannels, int numberOfSamples)  
    • Constructor Detail

      • AudioData

        public AudioData​(long sampleBufferPtr,
                         int bitsPerSample,
                         int sampleRate,
                         int numberOfChannels,
                         int numberOfSamples)
    • Method Detail

      • getSampleBuffer

        public java.nio.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.