AFREADMISC(3)

✨ AFREADMISC(3) ✨

okay bestie, sit down, hydrate, and let me tell you about afReadMisc, afWriteMisc, and afSeekMisc β€” three little functions from the Audio File Library that let you poke at the miscellaneous metadata hiding inside an audio file. it's giving backstage pass energy πŸŽ€


πŸ’– NAME πŸ’–

afReadMisc, afWriteMisc, afSeekMisc β€” your trio for accessing miscellaneous metadata in an audio file πŸ¦‹


🌸 SYNOPSIS 🌸

#include <audiofile.h>

int afReadMisc (AFfilehandle file, int miscid, void *buffer, int nbytes);

int afWriteMisc (AFfilehandle file, int miscid, const void *buffer, int nbytes);

int afSeekMisc (AFfilehandle file, int miscid, int offbytes);

literally just three lines and you're in. no cap. ✨


🫢 DESCRIPTION 🫢

afReadMisc reads up to nbytes from the miscellaneous data chunk identified by miscid in file. it's the "gimme the tea" of functions πŸ’…

afWriteMisc writes up to nbytes to the miscellaneous data chunk identified by miscid in file. putting your own little secrets in there, iconic πŸ‘‘

afSeekMisc changes the current offset within the miscellaneous data chunk identified by miscid to the offset offbytes. it's the "okay but actually let's look over here" move 🌈


⭐ RETURN VALUE ⭐

  • afReadMisc returns the number of bytes read from the specified miscellaneous chunk into the buffer referred to by buffer. πŸ’–
  • afWriteMisc returns the number of bytes written to the specified miscellaneous chunk from the buffer referred to by buffer. πŸŽ€
  • afSeekMisc returns the new location of the logical data pointer, measured as an offset in bytes from the beginning of the miscellaneous chunk's data area. πŸ¦‹

so like, always check the return value bestie, don't just vibe and assume 😭


πŸ’€ ERRORS πŸ’€

afReadMisc, afWriteMisc, and afSeekMisc can produce the following error codes:

  • AF_BAD_READ
  • AF_BAD_WRITE
  • AF_BAD_MISCSEEK
  • AF_BAD_MISCID
  • AF_BAD_TRACKID
  • AF_BAD_FILEHANDLE
if you see one of these, something is lowkey not okay β€” the read, the write, the seek, the misc id, the track id, or the file handle itself. check your args fr fr πŸ™ˆ

πŸ‘‘ AUTHOR πŸ‘‘

Michael Pruett <michael@68k.org> β€” the main character who made this happen 🌟


that's the whole page bestie, you ate that πŸ’…βœ¨

this was Audio File Library 0.3.6, dated 03/06/2013, and yes it's still serving AFREADMISC(3) energy. mwah πŸ«ΆπŸŽ€

πŸ“¦ where this page comes from