net.sf.fmj.media.codec.audio
Class RateConverter
java.lang.Object
net.sf.fmj.media.AbstractControls
net.sf.fmj.media.AbstractPlugIn
net.sf.fmj.media.AbstractCodec
net.sf.fmj.media.codec.audio.RateConverter
- All Implemented Interfaces:
- Codec, Controls, PlugIn
public class RateConverter
- extends AbstractCodec
Converts between different linear audio formats. Able to change signed/unsigned, endian-ness, bits per sample, sample rate, channels.
TODO: optimize.
TODO: improve quality of conversions. See for example http://www.fmjsoft.com/atquality.html (name fmjsoft is coincidental).
TODO: change stereo to mono by averaging, rather than by omission of 2nd channel.
TODO: handle data types besides byte arrays
This converter has so many formats that it causes a big slowdown in filter graph building, both for FMJ and JMF.
- Author:
- Ken Larson
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.media.PlugIn |
reset |
outputFormats
protected Format[] outputFormats
RateConverter
public RateConverter()
getName
public java.lang.String getName()
- Specified by:
getName
in interface PlugIn
- Overrides:
getName
in class AbstractPlugIn
getSupportedOutputFormats
public Format[] getSupportedOutputFormats(Format input)
- Specified by:
getSupportedOutputFormats
in interface Codec
- Specified by:
getSupportedOutputFormats
in class AbstractCodec
open
public void open()
- Specified by:
open
in interface PlugIn
- Overrides:
open
in class AbstractPlugIn
close
public void close()
- Specified by:
close
in interface PlugIn
- Overrides:
close
in class AbstractPlugIn
process
public int process(Buffer inputBuffer,
Buffer outputBuffer)
- Specified by:
process
in interface Codec
- Specified by:
process
in class AbstractCodec
setInputFormat
public Format setInputFormat(Format arg0)
- Specified by:
setInputFormat
in interface Codec
- Overrides:
setInputFormat
in class AbstractCodec
setOutputFormat
public Format setOutputFormat(Format arg0)
- Specified by:
setOutputFormat
in interface Codec
- Overrides:
setOutputFormat
in class AbstractCodec