org.farng.mp3.id3.FrameBodyRVRB Maven / Gradle / Ivy
Show all versions of jid3lib Show documentation
package org.farng.mp3.id3;
import org.farng.mp3.InvalidTagException;
import org.farng.mp3.object.ObjectNumberFixedLength;
import java.io.IOException;
import java.io.RandomAccessFile;
/**
* 4.13. Reverb
*
* Yet another subjective frame, with which you can adjust echoes of
different kinds.
* Reverb left/right is the delay between every bounce
in ms. Reverb bounces left/right is the number
* of bounces that should
be made. $FF equals an infinite number of bounces. Feedback is the
* amount of volume that should be returned to the next echo bounce. $00
*
* is 0%, $FF is 100%. If this value were $7F, there would be 50% volume
reduction on the
* first bounce, 50% of that on the second and so on.
Left to left means the sound from the left bounce
* to be played in the
left speaker, while left to right means sound from the left bounce to
* be played in the right speaker.
*
* 'Premix left to right' is the amount of left sound to be mixed in the
right before
* any reverb is applied, where $00 id 0% and $FF is 100%.
'Premix right to left' does the same thing,
* but right to left.
Setting both premix to $FF would result in a mono output (if the
* reverb is applied symmetric). There may only be one "RVRB"
*
* frame in
each tag.
*
* <Header for 'Reverb', ID: "RVRB">
Reverb
* left (ms) $xx xx
*
* Reverb right (ms)
* $xx xx
Reverb bounces, left
* $xx
Reverb bounces, right
* $xx
*
* Reverb feedback, left to left $xx
Reverb
* feedback, left to right $xx
Reverb feedback, right to right $xx
*
* Reverb feedback, right to left $xx
Premix left to
* right $xx
Premix
* right to left $xx
*
*
*
* @author Eric Farng
* @version $Revision: 1.4 $
*/
public class FrameBodyRVRB extends AbstractID3v2FrameBody {
/**
* Creates a new FrameBodyRVRB object.
*/
public FrameBodyRVRB() {
super();
}
/**
* Creates a new FrameBodyRVRB object.
*/
public FrameBodyRVRB(final FrameBodyRVRB body) {
super(body);
}
/**
* Creates a new FrameBodyRVRB object.
*/
public FrameBodyRVRB(final short reverbLeft,
final short reverbRight,
final byte reverbBouncesLeft,
final byte reverbBouncesRight,
final byte reverbFeedbackLeftToLeft,
final byte reverbFeedbackLeftToRight,
final byte reverbFeedbackRightToRight,
final byte reverbFeedbackRightToLeft,
final byte premixLeftToRight,
final byte premixRightToLeft) {
setObject("Reverb Left", new Short(reverbLeft));
setObject("Reverb Right", new Short(reverbRight));
setObject("Reverb Bounces Left", new Byte(reverbBouncesLeft));
setObject("Reverb Bounces Right", new Byte(reverbBouncesRight));
setObject("Reverb Feedback Left To Left", new Byte(reverbFeedbackLeftToLeft));
setObject("Reverb Feedback Left To Right", new Byte(reverbFeedbackLeftToRight));
setObject("Reverb Feedback Right To Right", new Byte(reverbFeedbackRightToRight));
setObject("Reverb Feedback Right to Left", new Byte(reverbFeedbackRightToLeft));
setObject("Premix Left To Right", new Byte(premixLeftToRight));
setObject("Premix Right To Left", new Byte(premixRightToLeft));
}
/**
* Creates a new FrameBodyRVRB object.
*/
public FrameBodyRVRB(final RandomAccessFile file) throws IOException, InvalidTagException {
this.read(file);
}
public String getIdentifier() {
return "RVRB";
}
protected void setupObjectList() {
appendToObjectList(new ObjectNumberFixedLength("Reverb Left", 2));
appendToObjectList(new ObjectNumberFixedLength("Reverb Right", 2));
appendToObjectList(new ObjectNumberFixedLength("Reverb Bounces Left", 1));
appendToObjectList(new ObjectNumberFixedLength("Reverb Bounces Right", 1));
appendToObjectList(new ObjectNumberFixedLength("Reverb Feedback Left To Left", 1));
appendToObjectList(new ObjectNumberFixedLength("Reverb Feedback Left To Right", 1));
appendToObjectList(new ObjectNumberFixedLength("Reverb Feedback Right To Right", 1));
appendToObjectList(new ObjectNumberFixedLength("Reverb Feedback Right to Left", 1));
appendToObjectList(new ObjectNumberFixedLength("Premix Left To Right", 1));
appendToObjectList(new ObjectNumberFixedLength("Premix Right To Left", 1));
}
}