AFINITFILEFORMAT(3)

✨ AFINITFILEFORMAT(3) ✨

okay bestie, sit down, hydrate, because we're talking about afInitFileFormat πŸ’– β€” it lives in section 3 of the manual (that's the library-calls section, iykyk), and it is literally the glow-up your audio file setup has been waiting for.


🌸 NAME 🌸

afInitFileFormat β€” initialize file format of an audio file setup πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <audiofile.h>

void afInitFileFormat(AFfilesetup setup, int fileFormat);

πŸ’… PARAMETERS πŸ’…

  • setup β€” a valid file setup created by afNewFileSetup(3). like, it has to be valid, bestie, don't come at it with a fake one πŸ™ˆ
  • fileFormat β€” an integer constant specifying a file format. yes, an integer constant. we'll get to the whole list in a sec 🫢

🌈 DESCRIPTION 🌈

So here's the tea β˜• β€” you've got an AFfilesetup structure, right? And you made it with afNewFileSetup(3), iconic. Now you hand it to afInitFileFormat, and it initializes the file format to whatever fileFormat you passed in. That's it. That's the whole job. Main character behavior honestly. πŸ‘‘

Here are the file formats that are currently supported β€” every single one, no skips, no cap:

  • AF_FILE_RAWDATA β€” raw audio data
  • AF_FILE_AIFF β€” Audio Interchange File Format
  • AF_FILE_AIFFC β€” Audio Interchange File Format AIFF-C
  • AF_FILE_NEXTSND β€” NeXT .snd/Sun .au
  • AF_FILE_WAVE β€” Microsoft RIFF WAVE
  • AF_FILE_BICSF β€” Berkeley/IRCAM/CARL Sound File
  • AF_FILE_AVR β€” Audio Visual Research
  • AF_FILE_IFF_8SVX β€” Amiga IFF/8SVX
  • AF_FILE_SAMPLEVISION β€” Sample Vision
  • AF_FILE_VOC β€” Creative Voice File
  • AF_FILE_NIST_SPHERE β€” NIST SPHERE
  • AF_FILE_CAF β€” Core Audio Format

a whole buffet of formats, fr fr πŸ“βœ¨


πŸ’€ ERRORS πŸ’€

ngl, afInitFileFormat can produce the following errors, and when it does, it's giving drama:

  • AF_BAD_FILESETUP β€” setup represents an invalid file setup. (the setup said "not today" 😭)
  • AF_BAD_FILEFMT β€” fileFormat represents an unknown file format. (who is she? we don't know her πŸ’€)
  • AF_BAD_NOT_IMPLEMENTED β€” fileFormat represents a file format which is not currently implemented. (vibe's real, the code isn't πŸ™ˆ)
bestie, if you see one of these, don't panic β€” just check which of the three it is and fix accordingly 🫢

πŸ‘€ SEE ALSO πŸ‘€

  • afNewFileSetup(3) β€” the origin story, the prequel, the one that made setup in the first place 🧚

πŸŽ€ AUTHOR πŸŽ€

Michael Pruett <michael@68k.org> β€” the legend, the moment, the actual author πŸ’œ


Audio File Library 0.3.6 β€” dated 03/06/2013 β€” and that's the whole page, bestie! you ate that. periodt. πŸ’…βœ¨πŸ¦‹πŸŒΈπŸ’–

πŸ“¦ where this page comes from