GSM_PRINT(3)

πŸ“¦
version 1.0.24 Β· 2 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0

✨ GSM_PRINT(3) ✨

okay bestie so this is a page from the Library Functions Manual, and it's all about gsm_print β€” the GSM 06.10 supplementary function for debugging. yes it's a real manual page and yes it slays πŸ’…


🌸 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;

like. the vibes are immaculate and the signature is right there, no cap πŸ’–


πŸ¦‹ DESCRIPTION πŸ¦‹

So gsm is an implementation of the final draft GSM 06.10 standard for full-rate speech transcoding β€” which is, lowkey, a lossy speech compression algorithm 😭 like it literally throws bits away on purpose and that's the whole point.

The compressed form? It involves 76 variables with different numbers of significant bits, all packed into 33 bytes. 76 things. 33 bytes. the math is mathing and honestly it's giving chaos πŸŒ€βœ¨

So if you're the type of main character who wants to investigate the details of this coding scheme (iconic behavior), gsm_print() is your girl: it dumps the contents of individual gsm_frames to a file pointer provided by the application. you bring the FILE *, it brings the tea β˜•πŸ’…


⭐ RETURN VALUE ⭐

  • gsm_print() returns -1 if the frame is invalid πŸ™ˆ
  • otherwise it returns 0 🫢

that's it that's the whole vibe check βœ…


🌈 EXAMPLE 🌈

a single frame looks like this, and ngl it's kind of a masterpiece:

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

look at those numbers go 🧚✨ ate and left no crumbs


πŸ’€ BUGS πŸ’€

found a bug? do not come for me, come for the actual humans πŸ’Œ please direct bug reports to:

  • jutta@pobox.com
  • cabo@tzi.org

πŸ‘‘ SEE ALSO πŸ‘‘

go read those too, iykyk πŸ“šπŸ’œ


and that's the whole page bestie!! it lives in the Library Functions Manual as GSM_PRINT(3) and that's the whole sign-off πŸŽ€πŸ«Ά stay compressed, stay lossy, stay iconic πŸ’–βœ¨πŸŒΈ