int gsm_option(handle, option, valueP);
gsm handle;
int option;
int * valueP;
The gsm_option() function can be used to set and query various options or flags that are not needed for regular GSM 06.10 encoding or decoding, but might be of interest in special cases.
The second argument to gsm_option specifies what parameter should be changed or queried. The third argument is either a null pointer, in which case the current value of that parameter is returned; or it is a pointer to an integer containing the value you want to set, in which case the previous value will be returned.
The following options are defined:
GSM_OPT_VERBOSE
Verbosity level.
This option is only supported if the library was compiled
with debugging turned on, and may be used by developers of
compression algorithms to aid debugging.
The verbosity level can be changed at any time during encoding or decoding.
GSM_OPT_FAST
Faster compression algorithm.
This implementation offers a not strictly standard-compliant, but
faster compression algorithm that is compatible with the regular
method and does not noticably degrade audio quality.
The value passed to
gsm_option(handle, GSM_OPT_FAST, & value)
GSM_OPT_LTP_CUT
Enable, disable, or query the LTP cut-off optimization.
During encoding, the search for the long-term correlation
lag forms the bottleneck of the algorithm.
The ltp-cut option enables an approximation that disregards most
of the samples for purposes of finding that correlation,
and hence speeds up the encoding at a noticable loss in quality.
The value passed to
gsm_option(handle, GSM_OPT_LTP_CUT, & value)
GSM_OPT_WAV49
WAV-style byte ordering.
A WAV file of type #49 contains GSM 06.10-encoded frames.
Unfortunately, the framing and code ordering of the WAV version
are incompatible with the native ones of this GSM 06.10 library.
The GSM_OPT_WAV49 option turns on a different packing
algorithm that produces alternating frames of 32 and 33 bytes
(or makes it consume alternating frames of 33 and 32 bytes, note
the opposite order of the two numbers) which, when concatenated,
can be used in the body of a WAV #49 frame.
It is up to the user program to write a WAV header, if any;
neither the library itself nor the toast program produce
complete WAV files.
The value passed to
gsm_option(handle, GSM_OPT_WAV49, & value)
GSM_OPT_FRAME_CHAIN
Query or set the chaining byte.
Between the two frames of a WAV-style encoding, the GSM 06.10 library
must keep track of one half-byte that is technically part of the first
frame, but will be written as the first four bits of the second.
This half-byte are the lowest four bits of the value returned by,
and optionally set by,
gsm_option(handle, GSM_OPT_FRAME_CHAIN, & value)
GSM_OPT_FRAME_INDEX
Query or set the current frame's index in a format's
alternating list of frames.
The WAV #49 framing uses two alternating types of frames.
Which type the next GSM-coded frame belongs to can be queried, or,
when decoding, announced, using
gsm_option(handle, GSM_OPT_FRAME_INDEX, & value)