Package ej.audio.mp3

Class Mp3AudioFormat

java.lang.Object
ej.audio.AudioFormat
ej.audio.mp3.Mp3AudioFormat

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

    • 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 Details

    • getAudioFormatFromInputStream

      public static Mp3AudioFormat getAudioFormatFromInputStream(InputStream inputStream) throws ej.audio.AudioException, IOException
      Gets AudioFormat from the given InputStream.
      Parameters:
      inputStream - the input stream
      Returns:
      the audio format
      Throws:
      ej.audio.AudioException - when format is not recognized
      IOException - when input stream cannot be read
    • getEncoding

      public String getEncoding()
      Specified by:
      getEncoding in class ej.audio.AudioFormat
    • getParameters

      public int[] getParameters()
      Specified by:
      getParameters in class ej.audio.AudioFormat