Package org.apache.tika.parser.mp3
Class AudioFrame
- java.lang.Object
- 
- org.apache.tika.parser.mp3.AudioFrame
 
- 
- 
Field SummaryFields Modifier and Type Field Description static intLAYER_1Constant for audio layer 1.static intLAYER_2Constant for audio layer 2.static intLAYER_3Constant for audio layer 3.static intMPEG_V1Constant for the MPEG version 1.static intMPEG_V2Constant for the MPEG version 2.static intMPEG_V2_5Constant for the MPEG version 2.5.
 - 
Constructor SummaryConstructors Constructor Description AudioFrame(int mpegVersion, int layer, int bitRate, int sampleRate, int channels, int length, float duration)Creates a new instance ofAudioFrameand initializes all properties.AudioFrame(int h1, int h2, int h3, int h4, InputStream in)Deprecated.Use the constructor which is passed all values directly.AudioFrame(InputStream stream, ContentHandler handler)Deprecated.Use the constructor which is passed all values directly.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetBitRate()Get the bit rate in bit per second.intgetChannels()Get the number of channels (1=mono, 2=stereo)floatgetDuration()Returns the duration in milliseconds.intgetLayer()Get the audio layer code.intgetLength()Returns the frame length in bytes.intgetSampleRate()Get the sampling rate, in HzStringgetVersion()intgetVersionCode()Get the version code.static booleanisAudioHeader(int h1, int h2, int h3, int h4)Does this appear to be a 4 byte audio frame header?
 
- 
- 
- 
Field Detail- 
MPEG_V1public static final int MPEG_V1 Constant for the MPEG version 1.- See Also:
- Constant Field Values
 
 - 
MPEG_V2public static final int MPEG_V2 Constant for the MPEG version 2.- See Also:
- Constant Field Values
 
 - 
MPEG_V2_5public static final int MPEG_V2_5 Constant for the MPEG version 2.5.- See Also:
- Constant Field Values
 
 - 
LAYER_1public static final int LAYER_1 Constant for audio layer 1.- See Also:
- Constant Field Values
 
 - 
LAYER_2public static final int LAYER_2 Constant for audio layer 2.- See Also:
- Constant Field Values
 
 - 
LAYER_3public static final int LAYER_3 Constant for audio layer 3.- See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
AudioFrame@Deprecated public AudioFrame(InputStream stream, ContentHandler handler) throws IOException, SAXException, TikaException Deprecated.Use the constructor which is passed all values directly.- Throws:
- IOException
- SAXException
- TikaException
 
 - 
AudioFrame@Deprecated public AudioFrame(int h1, int h2, int h3, int h4, InputStream in) throws IOException Deprecated.Use the constructor which is passed all values directly.- Throws:
- IOException
 
 - 
AudioFramepublic AudioFrame(int mpegVersion, int layer, int bitRate, int sampleRate, int channels, int length, float duration)Creates a new instance ofAudioFrameand initializes all properties.- Parameters:
- mpegVersion- the code for the MPEG version
- layer- the code for the layer
- bitRate- the bit rate (in bps)
- sampleRate- the sample rate (in samples per second)
- channels- the number of channels
- length- the frame length (in bytes)
- duration- the duration of this frame (in milliseconds)
 
 
- 
 - 
Method Detail- 
isAudioHeaderpublic static boolean isAudioHeader(int h1, int h2, int h3, int h4)Does this appear to be a 4 byte audio frame header?
 - 
getVersionpublic String getVersion() 
 - 
getSampleRatepublic int getSampleRate() Get the sampling rate, in Hz
 - 
getChannelspublic int getChannels() Get the number of channels (1=mono, 2=stereo)
 - 
getVersionCodepublic int getVersionCode() Get the version code.- Returns:
- the version code (one of the MPEGconstants)
 
 - 
getLayerpublic int getLayer() Get the audio layer code.- Returns:
- the audio layer (one of the LAYERconstants)
 
 - 
getBitRatepublic int getBitRate() Get the bit rate in bit per second.- Returns:
- the bit rate
 
 - 
getLengthpublic int getLength() Returns the frame length in bytes.- Returns:
- the frame length
 
 - 
getDurationpublic float getDuration() Returns the duration in milliseconds.- Returns:
- the duration
 
 
- 
 
-