Package org.red5.io.mp3.impl
Class MP3Header
- java.lang.Object
-
- org.red5.io.mp3.impl.MP3Header
-
public class MP3Header extends Object
Header of a MP3 frame.- Author:
- The Red5 Project, Joachim Bauch (jojo@struktur.de)
- See Also:
- File format
-
-
Constructor Summary
Constructors Constructor Description MP3Header(int data)Creates MP3 header from frame sync value
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doubleframeDuration()Return the duration of the frame for this header.intframeSize()Calculate the size of a MP3 frame for this header.intgetBitRate()Getter for bitrateintgetData()Getter for frame sync word dataintgetSampleRate()Getter for sample ratebooleanisProtected()Whether MP3 has protection bitbooleanisStereo()Whether stereo playback mode is used
-
-
-
Method Detail
-
getData
public int getData()
Getter for frame sync word data- Returns:
- Frame sync word data
-
isStereo
public boolean isStereo()
Whether stereo playback mode is used- Returns:
trueif stereo mode is used,falseotherwise
-
isProtected
public boolean isProtected()
Whether MP3 has protection bit- Returns:
trueif MP3 has protection bit,falseotherwise
-
getBitRate
public int getBitRate()
Getter for bitrate- Returns:
- File bitrate
-
getSampleRate
public int getSampleRate()
Getter for sample rate- Returns:
- Sampling rate
-
frameSize
public int frameSize()
Calculate the size of a MP3 frame for this header.- Returns:
- size of the frame including the header
-
frameDuration
public double frameDuration()
Return the duration of the frame for this header.- Returns:
- The duration in milliseconds
-
-