## 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 (red5@osflash.org), Joachim Bauch (jojo@struktur.de)
See Also:
  File format

Constructor Summary
`MP3Header(int data)` Creates MP3 header from frame sync value

Method Summary
`double` `frameDuration()` Return the duration of the frame for this header.
`int` `frameSize()` Calculate the size of a MP3 frame for this header.
`int` `getBitRate()` Getter for bitrate
`int` `getData()` Getter for frame sync word data
`int` `getSampleRate()` Getter for sample rate
`boolean` `isProtected()` Whether MP3 has protection bit
`boolean` `isStereo()` Whether stereo playback mode is used

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### MP3Header

    public MP3Header(int data)
              throws Exception

  Creates MP3 header from frame sync value

  Parameters:
    `data` - Frame sync data
  Throws:
    `Exception` - On invalid frame synchronization

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:
    `true` if stereo mode is used, `false` otherwise

### isProtected

    public boolean isProtected()

  Whether MP3 has protection bit

  Returns:
    `true` if MP3 has protection bit, `false` otherwise

### 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

Copyright © 2006-2010 The Red5 Project