Package javazoom.spi.mpeg.sampled.file
Class MpegAudioFileReader
- java.lang.Object
-
- TAudioFileReader
-
- javazoom.spi.mpeg.sampled.file.MpegAudioFileReader
-
public class MpegAudioFileReader extends TAudioFileReader
This class implements AudioFileReader for MP3 SPI.
-
-
Field Summary
Fields Modifier and Type Field Description static int
INITAL_READ_LENGTH
static java.lang.String
VERSION
-
Constructor Summary
Constructors Constructor Description MpegAudioFileReader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.sound.sampled.AudioFileFormat
getAudioFileFormat(java.io.File file)
Returns AudioFileFormat from File.javax.sound.sampled.AudioFileFormat
getAudioFileFormat(java.io.InputStream inputStream, long mediaLength)
Returns AudioFileFormat from inputstream and medialength.javax.sound.sampled.AudioFileFormat
getAudioFileFormat(java.net.URL url)
Returns AudioFileFormat from URL.javax.sound.sampled.AudioInputStream
getAudioInputStream(java.io.File file)
Returns AudioInputStream from file.javax.sound.sampled.AudioInputStream
getAudioInputStream(java.io.InputStream inputStream)
Return the AudioInputStream from the given InputStream.javax.sound.sampled.AudioInputStream
getAudioInputStream(java.net.URL url)
Returns AudioInputStream from url.protected void
loadShoutcastInfo(java.io.InputStream input, java.util.HashMap props)
Load shoutcast (ICY) info.protected void
parseID3v1Frames(byte[] frames, java.util.HashMap props)
Parser ID3v1 framesprotected void
parseID3v2Frames(java.io.InputStream frames, java.util.HashMap props)
Parse ID3v2 frames to add album (TALB), title (TIT2), date (TYER), author (TPE1), copyright (TCOP), comment (COMM) ...protected java.lang.String
parseText(byte[] bframes, int offset, int size, int skip)
Parse Text Frames.
-
-
-
Field Detail
-
VERSION
public static final java.lang.String VERSION
- See Also:
- Constant Field Values
-
INITAL_READ_LENGTH
public static int INITAL_READ_LENGTH
-
-
Method Detail
-
getAudioFileFormat
public javax.sound.sampled.AudioFileFormat getAudioFileFormat(java.io.File file) throws javax.sound.sampled.UnsupportedAudioFileException, java.io.IOException
Returns AudioFileFormat from File.- Throws:
javax.sound.sampled.UnsupportedAudioFileException
java.io.IOException
-
getAudioFileFormat
public javax.sound.sampled.AudioFileFormat getAudioFileFormat(java.net.URL url) throws javax.sound.sampled.UnsupportedAudioFileException, java.io.IOException
Returns AudioFileFormat from URL.- Throws:
javax.sound.sampled.UnsupportedAudioFileException
java.io.IOException
-
getAudioFileFormat
public javax.sound.sampled.AudioFileFormat getAudioFileFormat(java.io.InputStream inputStream, long mediaLength) throws javax.sound.sampled.UnsupportedAudioFileException, java.io.IOException
Returns AudioFileFormat from inputstream and medialength.- Throws:
javax.sound.sampled.UnsupportedAudioFileException
java.io.IOException
-
getAudioInputStream
public javax.sound.sampled.AudioInputStream getAudioInputStream(java.io.File file) throws javax.sound.sampled.UnsupportedAudioFileException, java.io.IOException
Returns AudioInputStream from file.- Throws:
javax.sound.sampled.UnsupportedAudioFileException
java.io.IOException
-
getAudioInputStream
public javax.sound.sampled.AudioInputStream getAudioInputStream(java.net.URL url) throws javax.sound.sampled.UnsupportedAudioFileException, java.io.IOException
Returns AudioInputStream from url.- Throws:
javax.sound.sampled.UnsupportedAudioFileException
java.io.IOException
-
getAudioInputStream
public javax.sound.sampled.AudioInputStream getAudioInputStream(java.io.InputStream inputStream) throws javax.sound.sampled.UnsupportedAudioFileException, java.io.IOException
Return the AudioInputStream from the given InputStream.- Throws:
javax.sound.sampled.UnsupportedAudioFileException
java.io.IOException
-
parseID3v1Frames
protected void parseID3v1Frames(byte[] frames, java.util.HashMap props)
Parser ID3v1 frames- Parameters:
frames
-props
-
-
parseID3v2Frames
protected void parseID3v2Frames(java.io.InputStream frames, java.util.HashMap props)
Parse ID3v2 frames to add album (TALB), title (TIT2), date (TYER), author (TPE1), copyright (TCOP), comment (COMM) ...- Parameters:
frames
-props
-
-
parseText
protected java.lang.String parseText(byte[] bframes, int offset, int size, int skip)
Parse Text Frames.- Parameters:
bframes
-offset
-size
-skip
-- Returns:
-
loadShoutcastInfo
protected void loadShoutcastInfo(java.io.InputStream input, java.util.HashMap props) throws java.io.IOException
Load shoutcast (ICY) info.- Parameters:
input
-props
-- Throws:
java.io.IOException
-
-