Packetizerpublic class Packetizer extends AudioPacketizer Implements an MuLaw Packetizer. |
Constructors Summary |
---|
public Packetizer()
packetSize=480;
supportedInputFormats = new AudioFormat[] {
new AudioFormat(
AudioFormat.ULAW,
Format.NOT_SPECIFIED,
8,
1,
Format.NOT_SPECIFIED,
Format.NOT_SPECIFIED,
8,
Format.NOT_SPECIFIED,
Format.byteArray
)
} ;
defaultOutputFormats = new AudioFormat[] {
new AudioFormat(
AudioFormat.ULAW_RTP,
Format.NOT_SPECIFIED,
8,
1,
Format.NOT_SPECIFIED,
Format.NOT_SPECIFIED,
8,
Format.NOT_SPECIFIED,
Format.byteArray
)
} ;
PLUGIN_NAME="Mu-Law Packetizer";
|
Methods Summary |
---|
public java.lang.Object[] | getControls()
if (controls==null) {
controls=new Control[1];
controls[0]=new PacketSizeAdapter(this,packetSize,true);
}
return (Object[])controls;
| protected javax.media.Format[] | getMatchingOutputFormats(javax.media.Format in)
AudioFormat af =(AudioFormat) in;
supportedOutputFormats = new AudioFormat[] {
new AudioFormat(
AudioFormat.ULAW_RTP,
af.getSampleRate(),
8,
1,
Format.NOT_SPECIFIED,
Format.NOT_SPECIFIED,
8,
Format.NOT_SPECIFIED,
Format.byteArray
)
};
return supportedOutputFormats;
| public void | open()
setPacketSize(packetSize);
reset();
| public synchronized void | setPacketSize(int newPacketSize)
packetSize=newPacketSize;
sample_count = packetSize;
if (history==null) {
history=new byte[packetSize];
return;
}
if (packetSize > history.length ) {
byte[] newHistory=new byte[packetSize];
System.arraycopy(history,0,newHistory,0,historyLength);
history=newHistory;
}
|
|