Package ej.audio.mp3

Class Mp3AudioFormat


  • public class Mp3AudioFormat
    extends AudioFormat
    AudioFormat which represents the format of an audio sink with the MP3 encoding.
    • Constructor Detail

      • Mp3AudioFormat

        public Mp3AudioFormat​(int sampleRateHz,
                              int numChannels)
        Creates an MP3 audio format.
        Parameters:
        sampleRateHz - the sample rate (in Hz).
        numChannels - the number of channels.
        Throws:
        IllegalArgumentException - if the given sample rate or the given number of channels is less than or equal to zero.
    • Method Detail

      • getEncoding

        public String getEncoding()
        Description copied from class: AudioFormat
        Returns the data format of an audio stream.
        Specified by:
        getEncoding in class AudioFormat
        Returns:
        the encoding format string.
      • 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.