org.farng.mp3.id3
Class FrameBodyRVAD

java.lang.Object
  extended byorg.farng.mp3.AbstractMP3FileItem
      extended byorg.farng.mp3.AbstractMP3FragmentBody
          extended byorg.farng.mp3.id3.AbstractID3v2FrameBody
              extended byorg.farng.mp3.id3.FrameBodyRVAD

public class FrameBodyRVAD
extends AbstractID3v2FrameBody

4.12.Relative volume adjustment

This is a more subjective function than the previous ones. It allows the user to say how much he wants to increase/decrease the volume on each channel while the file is played. The purpose is to be able to align all files to a reference volume, so that you don't have to change the volume constantly. This frame may also be used to balance adjust the audio. If the volume peak levels are known then this could be described with the 'Peak volume right' and 'Peak volume left' field. If Peakvolume is not known these fields could be left zeroed or, if no other data follows, be completely omitted. There may only be one "RVAD" frame in each tag.

<Header for 'Relative volume adjustment', ID: "RVAD">
Increment/decrement%00xxxxxx
Bits used for volume descr.$xx
Relative volume change, right$xx xx (xx ...)
Relative volume change, left$xx xx (xx ...)
Peak volume right$xx xx (xx ...)
Peak volume left$xx xx (xx ...)

In the increment/decrement field bit 0 is used to indicate the right channel and bit 1 is used to indicate the left channel. 1 is increment and 0 is decrement.

The 'bits used for volume description' field is normally $10 (16 bits) for MPEG 2 layer I, II and III and MPEG 2.5. This value may not be $00. The volume is always represented with whole bytes, padded in the beginning (highest bits) when 'bits used for volume description' is not a multiple of eight.

This datablock is then optionally followed by a volume definition for the left and right back channels. If this information is appended to the frame the first two channels will be treated as front channels. In the increment/decrement field bit 2 is used to indicate the right back channel and bit 3 for the left back channel.

Relative volume change, right back$xx xx (xx ...)
Relative volume change, left back$xx xx (xx ...)
Peak volume right back$xx xx (xx ...)
Peak volume left back$xx xx (xx ...)

If the center channel adjustment is present the following is appended to the existing frame, after the left and right back channels. The center channel is represented by bit 4 in the increase/decrease field.

Relative volume change, center$xx xx (xx ...)
Peak volume center$xx xx (xx ...)

If the bass channel adjustment is present the following is appended to the existing frame, after the center channel. The bass channel is represented by bit 5 in the increase/decrease field.

Relative volume change, bass$xx xx (xx ...)
Peak volume bass$xx xx (xx ...)

Version:
$Revision: 1.5 $
Author:
Eric Farng`

Constructor Summary
FrameBodyRVAD()
          Creates a new FrameBodyRVAD object.
FrameBodyRVAD(byte increment, byte bitsUsed, long relativeRight, long relativeLeft, long peakRight, long peakLeft, long relativeRightBack, long relativeLeftBack, long peakRightBack, long peakLeftBack, long relativeCenter, long peakCenter, long relativeBass, long peakBass)
          Creates a new FrameBodyRVAD object.
FrameBodyRVAD(FrameBodyRVAD copyObject)
          Creates a new FrameBodyRVAD object.
FrameBodyRVAD(java.io.RandomAccessFile file)
          Creates a new FrameBodyRVAD object.
 
Method Summary
 void equals()
          This method is not yet supported.
 java.lang.String getIdentifier()
          ID string that usually corresponds to the class name, but can be displayed to the user.
 int getSize()
          Returns the estimated size in bytes of this object if it was to be written to file.
 void read(java.io.RandomAccessFile file)
          Read the data from the given file into this object.
protected  void setupObjectList()
          Create the order of MP3Object objects that this body expects.
 java.lang.String toString()
          Calls toString for all MP3Object objects and creates a string with a new line character.
 void write(java.io.RandomAccessFile file)
          Write the contents of this object to the file at the position it is currently at.
 
Methods inherited from class org.farng.mp3.id3.AbstractID3v2FrameBody
equals, readHeader, writeHeader
 
Methods inherited from class org.farng.mp3.AbstractMP3FragmentBody
appendToObjectList, getBriefDescription, getDescription, getObject, getObjectListIterator, has6ByteHeader, isSubsetOf, iterator, setObject
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FrameBodyRVAD

public FrameBodyRVAD()
Creates a new FrameBodyRVAD object.


FrameBodyRVAD

public FrameBodyRVAD(FrameBodyRVAD copyObject)
Creates a new FrameBodyRVAD object.


FrameBodyRVAD

public FrameBodyRVAD(byte increment,
                     byte bitsUsed,
                     long relativeRight,
                     long relativeLeft,
                     long peakRight,
                     long peakLeft,
                     long relativeRightBack,
                     long relativeLeftBack,
                     long peakRightBack,
                     long peakLeftBack,
                     long relativeCenter,
                     long peakCenter,
                     long relativeBass,
                     long peakBass)
Creates a new FrameBodyRVAD object.


FrameBodyRVAD

public FrameBodyRVAD(java.io.RandomAccessFile file)
              throws java.io.IOException,
                     InvalidTagException
Creates a new FrameBodyRVAD object.

Method Detail

getIdentifier

public java.lang.String getIdentifier()
Description copied from class: AbstractMP3FileItem
ID string that usually corresponds to the class name, but can be displayed to the user. It is not indended to identify each individual instance.

Specified by:
getIdentifier in class AbstractMP3FileItem
Returns:
ID string

getSize

public int getSize()
Description copied from class: AbstractMP3FragmentBody
Returns the estimated size in bytes of this object if it was to be written to file. This is not guaranteed to be accurate 100% of the time.

Overrides:
getSize in class AbstractMP3FragmentBody
Returns:
estimated size in bytes of this object

equals

public void equals()
This method is not yet supported.

Throws:
java.lang.UnsupportedOperationException - This method is not yet supported

setupObjectList

protected void setupObjectList()
Description copied from class: AbstractMP3FragmentBody
Create the order of MP3Object objects that this body expects. This method needs to be overwritten.

Specified by:
setupObjectList in class AbstractMP3FragmentBody

read

public void read(java.io.RandomAccessFile file)
          throws java.io.IOException,
                 InvalidTagException
Description copied from class: AbstractMP3FragmentBody
Read the data from the given file into this object. The file needs to have its file pointer in the correct location.

Overrides:
read in class AbstractMP3FragmentBody
Parameters:
file - file to read from
Throws:
InvalidTagException - if there is any error in the data format.
java.io.IOException - on any I/O error

toString

public java.lang.String toString()
Description copied from class: AbstractMP3FragmentBody
Calls toString for all MP3Object objects and creates a string with a new line character.

Overrides:
toString in class AbstractMP3FragmentBody
Returns:
description string

write

public void write(java.io.RandomAccessFile file)
           throws java.io.IOException
Description copied from class: AbstractMP3FragmentBody
Write the contents of this object to the file at the position it is currently at.

Overrides:
write in class AbstractMP3FragmentBody
Parameters:
file - destination file
Throws:
java.io.IOException - on any I/O error


Copyright (c) 2004 Eric Farng