Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
Task
org.xiph.speex.ant.JSpeexEncoderTask
public class JSpeexEncoderTask
extends Task
Task
to Encode an audio file from PCM Wave to Speex.
Here is an usage example:
Field Summary | |
static String |
|
static int |
|
static int |
|
static int |
|
static int |
|
static int |
|
static int |
|
static String |
|
static int |
|
protected int |
|
protected int |
|
protected int |
|
private File |
|
private File |
|
protected int |
|
protected boolean |
|
private boolean | |
protected int |
|
protected boolean |
|
protected int |
|
private int |
|
protected int |
|
private boolean |
|
protected int |
|
private File |
|
private Vector |
|
protected int |
|
protected boolean |
|
protected boolean |
|
protected float |
|
private boolean |
|
Method Summary | |
void |
|
private File |
|
void |
|
void |
|
protected static int |
|
protected static int |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
private void |
|
void |
|
public static final String COPYRIGHT
Copyright display String
public static final int DEBUG
Print level for messages : Print debug information
- Field Value:
- 0
public static final int ERROR
Print level for messages : Print only errors
- Field Value:
- 3
public static final int FILE_FORMAT_OGG
File format for input or output audio file: Ogg
- Field Value:
- 1
public static final int FILE_FORMAT_RAW
File format for input or output audio file: Raw
- Field Value:
- 0
public static final int FILE_FORMAT_WAVE
File format for input or output audio file: Wave
- Field Value:
- 2
public static final int INFO
Print level for messages : Print basic information
- Field Value:
- 1
public static final String VERSION
Version of the Speex Encoder
public static final int WARN
Print level for messages : Print only warnings and errors
- Field Value:
- 2
protected int bitrate
Defines the desired bitrate for the encoded audio.
protected int channels
Defines the number of channels of the audio input (1=mono, 2=stereo).
protected int complexity
Defines the encoders algorithmic complexity.
private File destDir
Directory to place destination files
private File destFile
Destination file of decoded audio
protected int destFormat
Defines File format for output audio file (Raw or Wave).
protected boolean dtx
Defines whether or not to use DTX (Discontinuous Transmission).
private boolean failOnError
protected int mode
Defines the encoder mode (0=NB, 1=WB and 2-UWB).
protected boolean modeset
Whether the mode is manualy set or automatically determined.
protected int nframes
Defines the number of frames per speex packet.
private int printlevel
Print level for messages
protected int quality
Defines the encoder quality setting (integer from 0 to 10).
private boolean quiet
Tells the task to suppress all but the most important output
protected int sampleRate
Defines the sampling rate of the audio input.
private File srcFile
Source file to decode
private final Vector srcFileset
List of source files to decode
protected int srcFormat
Defines File format for input audio file (Raw, Ogg or Wave).
protected boolean vad
Defines whether or not to use VAD (Voice Activity Detection).
protected boolean vbr
Defines whether or not to use VBR (Variable Bit Rate).
protected float vbr_quality
Defines the encoder VBR quality setting (float from 0 to 10).
private boolean verbose
Tells the task to output as much information as possible
public void addFileset(FileSet set)
Handles thefileset
child element.
- Parameters:
set
-
private File buildDestFile(File srcFile)
Builds and returns the destination file.
- Parameters:
srcFile
-
- Returns:
- the destination file.
public void encode(File srcPath, File destPath) throws IOException
Encodes a PCM file to Speex.
- Parameters:
srcPath
-destPath
-
public void execute() throws BuildException
The method executing the task.
protected static int readInt(byte[] data, int offset)
Converts Little Endian (Windows) bytes to an int (Java uses Big Endian).
- Parameters:
data
- the data to read.offset
- the offset from which to start reading.
- Returns:
- the integer value of the reassembled bytes.
protected static int readShort(byte[] data, int offset)
Converts Little Endian (Windows) bytes to an short (Java uses Big Endian).
- Parameters:
data
- the data to read.offset
- the offset from which to start reading.
- Returns:
- the integer value of the reassembled bytes.
public void setComplexity(int complexity)
Handles thecomplexity
attribute.
- Parameters:
complexity
- the attribute value converted to an integer.
public void setDestdir(File dir)
Handles thedestdir
attribute.
- Parameters:
dir
- the attribute value converted to a File.
public void setDestfile(File file)
Handles thedestfile
attribute.
- Parameters:
file
- the attribute value converted to a File.
public void setDtx(boolean dtx)
Handles thedtx
attribute.
- Parameters:
dtx
- the attribute value converted to a boolean.
public void setFailonerror(boolean failOnError)
Handles thefailonerror
attribute.
- Parameters:
failOnError
- the attribute value converted to a boolean.
public void setMode(String mode)
Handles themode
attribute.
- Parameters:
mode
- the attribute value converted to a String.
public void setNframes(int nframes)
Handles thenframes
attribute.
- Parameters:
nframes
- the attribute value converted to an integer.
public void setQuality(float quality)
Handles thequality
attribute.
- Parameters:
quality
- the attribute value converted to a float.
public void setQuiet(boolean quiet)
Handles thequiet
attribute.
- Parameters:
quiet
- the attribute value converted to a boolean.
public void setSrcfile(File file)
Handles thesrcfile
attribute.
- Parameters:
file
- the attribute value converted to a File.
public void setVad(boolean vad)
Handles thevad
attribute.
- Parameters:
vad
- the attribute value converted to a boolean.
public void setVbr(boolean vbr)
Handles thevbr
attribute.
- Parameters:
vbr
- the attribute value converted to a boolean.
public void setVerbose(boolean verbose)
Handles theverbose
attribute.
- Parameters:
verbose
- the attribute value converted to a boolean.
private void setupTask(File srcPath, File destPath)
Setup some task variables.
- Parameters:
srcPath
- the Speex encoded source file.destPath
- the destination file.
public void version()
Prints the version.