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 Summary
ConstructorsConstructorDescriptionMp3AudioFormat(int sampleRateHz, int numChannels) Creates an MP3 audio format. -
Method Summary
Modifier and TypeMethodDescriptionstatic Mp3AudioFormatgetAudioFormatFromInputStream(InputStream inputStream) GetsAudioFormatfrom the givenInputStream.int[]
-
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 GetsAudioFormatfrom the givenInputStream.- Parameters:
inputStream- the input stream- Returns:
- the audio format
- Throws:
ej.audio.AudioException- when format is not recognizedIOException- when input stream cannot be read
-
getEncoding
- Specified by:
getEncodingin classej.audio.AudioFormat
-
getParameters
public int[] getParameters()- Specified by:
getParametersin classej.audio.AudioFormat
-