Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

gsm_print(3) [debian man page]

GSM_PRINT(3)						     Library Functions Manual						      GSM_PRINT(3)

NAME
gsm_print -- GSM 06.10 supplementary function for debugging SYNOPSIS
#include "gsm.h" #include <stdio.h> int gsm_print(f, g, frame); FILE * f; gsm g; gsm_frame frame; DESCRIPTION
Gsm is an implementation of the final draft GSM 06.10 standard for full-rate speech transcoding, a lossy speech compression algorithm. The compressed form involves 76 variables with different numbers of significant bits packed into 33 bytes. If you are interested in investigating the details of this coding scheme, gsm_print() can be used to dump the contents of individual gsm_frames to a file pointer provided by the application. RETURN VALUE
gsm_print() returns -1 if the frame is invalid, else 0. EXAMPLE
A single frame looks like this: LARc: 29 32 20 11 08 05 06 07 #1: Nc 0040 bc 0 Mc 1 xmaxc 60 06 04 00 03 03 06 04 02 02 04 05 04 01 #2: Nc 0045 bc 1 Mc 1 xmaxc 48 03 07 01 03 04 04 07 01 03 02 04 05 03 #3: Nc 0091 bc 1 Mc 1 xmaxc 46 00 03 03 07 01 06 02 04 05 03 03 02 04 #4: Nc 0120 bc 0 Mc 1 xmaxc 47 07 03 06 00 03 03 06 05 00 03 02 07 04 BUGS
Please direct bug reports to jutta@cs.tu-berlin.de and cabo@cs.tu-berlin.de. SEE ALSO
gsm(3), gsm_explode(3) GSM_PRINT(3)

Check Out this Related Man Page

GSM(3)							     Library Functions Manual							    GSM(3)

NAME
gsm_create, gsm_destroy, gsm_encode, gsm_decode -- GSM 06.10 lossy sound compression SYNOPSIS
#include "gsm.h" gsm gsm_create(); void gsm_encode(handle, src, dst) gsm handle; gsm_signal src[160]; gsm_frame dst; int gsm_decode(handle, src, dst) gsm handle; gsm_frame src; gsm_signal dst[160]; void gsm_destroy(handle) gsm handle; DESCRIPTION
Gsm is an implementation of the final draft GSM 06.10 standard for full-rate speech transcoding. gsm_create() initializes a gsm pass and returns a 'gsm' object which can be used as a handle in subsequent calls to gsm_decode(), gsm_encode() or gsm_destroy(). gsm_encode() encodes an array of 160 13-bit samples (given as gsm_signal's, signed integral values of at least 16 bits) into a gsm_frame of 33 bytes. (gsm_frame is a type defined as an array of 33 gsm_bytes in gsm.h.) gsm_decode() decodes a gsm_frame into an array of 160 13-bit samples (given as gsm_signals), which sound rather like what you handed to gsm_encode() on the other side of the wire. gsm_destroy() finishes a gsm pass and frees all storage associated with it. Sample format The following scaling is assumed for input to the algorithm: 0 1 11 12 S..v..v..v..v..v..v..v..v..v..v..v..v..*..*..* Only the top 13 bits are used as a signed input value. The output of gsm_decode() has the three lower bits set to zero. RETURN VALUE
gsm_create() returns an opaque handle object of type gsm, or 0 on error. gsm_decode() returns -1 if the passed frame is invalid, else 0. EXAMPLE
#include "gsm.h" gsm handle; gsm_frame buf; gsm_signal sample[160]; int cc, soundfd; play() { /* read compressed data from standard input, write to soundfd */ if (!(handle = gsm_create())) error... while (cc = read(0, (char *)buf, sizeof buf)) { if (cc != sizeof buf) error... if (gsm_decode(handle, buf, sample) < 0) error... if (write(soundfd, sample, sizeof sample) != sizeof sample) error... } gsm_destroy(handle); } record() { /* read from soundfd, write compressed to standard output */ if (!(handle = gsm_create())) error... while (cc = read(soundfd, sample, sizeof sample)) { if (cc != sizeof sample) error... gsm_encode(handle, sample, buf); if (write(1, (char *)buf, sizeof buf) != sizeof sample) error... } gsm_destroy(handle); } BUGS
Please direct bug reports to jutta@cs.tu-berlin.de and cabo@cs.tu-berlin.de. SEE ALSO
toast(1), gsm_print(3), gsm_explode(3), gsm_option(3) GSM(3)
Man Page