2 .\" Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
3 .\" Universitaet Berlin. See the accompanying file "COPYRIGHT" for
4 .\" details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
9 gsm_create, gsm_destroy, gsm_encode, gsm_decode \(em GSM\ 06.10 lossy sound compression
16 void gsm_encode(handle, src, dst)
24 int gsm_decode(handle, src, dst)
32 void gsm_destroy(handle)
37 Gsm is an implementation of the final draft GSM 06.10
38 standard for full-rate speech transcoding.
40 gsm_create() initializes a gsm pass and returns a 'gsm' object
41 which can be used as a handle in subsequent calls to gsm_decode(),
42 gsm_encode() or gsm_destroy().
44 gsm_encode() encodes an array of 160 13-bit samples (given as
45 gsm_signal's, signed integral values of at least 16 bits) into
46 a gsm_frame of 33 bytes.
47 (gsm_frame is a type defined as an array of 33 gsm_bytes in gsm.h.)
49 gsm_decode() decodes a gsm_frame into an array of 160 13-bit samples
50 (given as gsm_signals), which sound rather like what you handed to
51 gsm_encode() on the other side of the wire.
53 gsm_destroy() finishes a gsm pass and frees all storage associated
56 The following scaling is assumed for input to the algorithm:
60 S..v..v..v..v..v..v..v..v..v..v..v..v..*..*..*
63 Only the top 13 bits are used as a signed input value.
64 The output of gsm_decode() has the three lower bits set to zero.
67 gsm_create() returns an opaque handle object of type gsm, or 0 on error.
68 gsm_decode() returns -1 if the passed frame is invalid, else 0.
75 gsm_signal sample[160];
78 play() { /* read compressed data from standard input, write to soundfd */
80 if (!(handle = gsm_create())) error...
81 while (cc = read(0, (char *)buf, sizeof buf)) {
82 if (cc != sizeof buf) error...
83 if (gsm_decode(handle, buf, sample) < 0) error...
84 if (write(soundfd, sample, sizeof sample) != sizeof sample)
90 record() { /* read from soundfd, write compressed to standard output */
92 if (!(handle = gsm_create())) error...
93 while (cc = read(soundfd, sample, sizeof sample)) {
94 if (cc != sizeof sample) error...
95 gsm_encode(handle, sample, buf);
96 if (write(1, (char *)buf, sizeof buf) != sizeof sample)
103 Please direct bug reports to jutta@cs.tu-berlin.de and cabo@cs.tu-berlin.de.
105 toast(1), gsm_print(3), gsm_explode(3), gsm_option(3)