AFINITBYTEORDER(3)

πŸ’– NAME πŸ’–

okay so bestie, this page is afInitCompression β€” it initializes compression for a track in an audio file setup. that's the whole vibe. πŸŽ€

it lives in the Audio File Library manual, section 3, and the header up top literally reads AFINITBYTEORDER(3) β€” yes the title is a lil cursed and does not match the function, no cap, but the function you actually want is afInitCompression. iykyk. πŸ’…


✨ SYNOPSIS ✨

#include <audiofile.h>

void afInitCompression(AFfilesetup setup, int track, int compression);

🌸 PARAMETERS 🌸

  • setup β€” a valid file setup, the kind you get back from afNewFileSetup(3). that's your foundation, bestie.
  • track β€” which track inside the audio file setup we're talking about. for all currently supported file formats, track is always AF_DEFAULT_TRACK. always. no drama.
  • compression β€” an identifier for the compression type you want, like AF_COMPRESSION_G711_ULAW, used for the audio data in that track.

πŸ¦‹ DESCRIPTION πŸ¦‹

so you've got an AFfilesetup structure that came from afNewFileSetup(3), and you've got a track identified by track (which, reminder, is AF_DEFAULT_TRACK for all currently supported file formats), and afInitCompression does exactly what it says on the tin: it initializes that track to the compression you specified. slay. πŸ”₯

here are the compression types currently supported, and yes i am listing every single one because we don't skip:

  • AF_COMPRESSION_NONE β€” no compression at all. raw. unbothered. natural.
  • AF_COMPRESSION_G711_ULAW β€” CCITT G.711 mu-law encoding
  • AF_COMPRESSION_G711_ALAW β€” CCITT G.711 A-law encoding
  • AF_COMPRESSION_IMA β€” IMA ADPCM encoding
  • AF_COMPRESSION_MS_ADPCM β€” MS ADPCM encoding
  • AF_COMPRESSION_FLAC β€” FLAC
  • AF_COMPRESSION_ALAC β€” Apple Lossless Audio Codec

😭 ERRORS 😭

afInitCompression can produce the following errors, and when it does, it's giving "read the error code, bestie":

  • AF_BAD_FILESETUP β€” setup represents an invalid file setup. πŸ™ˆ
  • AF_BAD_TRACKID β€” track represents an invalid track identifier.
  • AF_BAD_COMPTYPE β€” compression represents an invalid compression type. πŸ’€

🌈 SEE ALSO 🌈


πŸ‘‘ AUTHOR πŸ‘‘

Michael Pruester... no wait, Michael Pruett <michael@68k.org> πŸ’œ


and that's the whole page, bestie. this one came out of the Audio File Library 0.3.6, dated 03/06/2013 β€” iconic behavior honestly, periodt. go forth and compress. 🫢✨

πŸ“¦ where this page comes from