Class PcmAudioFormat


  • public class PcmAudioFormat
    extends AudioFormat
    AudioFormat which represents data with the PCM (Pulse-Code Modulation) encoding.
    • Constructor Detail

      • PcmAudioFormat

        public PcmAudioFormat​(int sampleRate,
                              int numChannels,
                              int bitDepth,
                              boolean isBigEndian,
                              boolean isSigned)
        Creates a PCM audio format.
        Parameters:
        sampleRate - the sample rate (in Hz).
        numChannels - the number of channels.
        bitDepth - the bit depth (the number of bits per sample).
        isBigEndian - whether the data is in big endian or in little endian.
        isSigned - whether the data is signed or unsigned.
        Throws:
        IllegalArgumentException - if the given sample rate, the given number of channels or the given bit depth is less than or equal to zero.
    • Method Detail

      • getEncoding

        public String getEncoding()
        Description copied from class: AudioFormat
        Returns the encoding of this audio format.
        Specified by:
        getEncoding in class AudioFormat
        Returns:
        the encoding.
      • getParameters

        public int[] getParameters()
        Description copied from class: AudioFormat
        Returns the parameters of this audio format.

        The parameters depend on the encoding. The semantics of every parameter is known by the low-level audio implementation.

        Specified by:
        getParameters in class AudioFormat
        Returns:
        the parameters.