Package javaforce.codec.gsm
Class GSMEncoder
java.lang.Object
java.lang.Thread
javaforce.codec.gsm.GSMEncoder
- All Implemented Interfaces:
Runnable
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidencode(short[] asBuffer, byte[] abFrame) Encodes a block of data.voidencode(InputStream input, String output_file) Encode the specified InputStream.voidEncode the specified file.static voidRemove the header info from the stream and verifies the file type.Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
Constructor Details
-
GSMEncoder
public GSMEncoder()Encoder class constructor.
-
-
Method Details
-
stripAUHeader
Remove the header info from the stream and verifies the file type. As defined by the NeXT/Sun audio file format U-law (.au). For more info see the README file.
Note: Most of this info is not needed to reproduce the sound file after encoding. All that is needed is the magic number and the sampling rate to reproduce the sound file during decoding.- Parameters:
in- Strip the header from a Sun/Next formated sound stream.- Throws:
Exception
-
encode
Encode the specified file.
This method calls thestripAUHeadermethod for you.
stripAUHeader will verify file type.- Parameters:
input_file- The name of the file to encode.output_file- The name of the GSM encoded file.- Throws:
Exception
-
encode
Encode the specified InputStream.- Parameters:
input- The stream to encode.output_file- The name of the GSM encoded file.- Throws:
IOException
-
encode
public void encode(short[] asBuffer, byte[] abFrame) Encodes a block of data.- Parameters:
asBuffer- an 160-element array with the data to encode int PCM 16 bit format.abFrame- the encoded GSM frame (33 bytes).
-