roar_vs_read(3)

πŸ“¦ version 1.0~beta12, in ubuntu jammy

πŸ’– roar_vs_read(3) πŸ’–

okay bestie, we're in the RoarAudio Programmer's Manual today and the page is roar_vs_read(3) β€” yes, and its ride-or-die twin roar_vs_write(3) is coming along too, they're a package deal fr fr 🫢


✨ NAME ✨

roar_vs_read, roar_vs_write β€” read or write data from or to the sound server 🎧


🌸 SYNOPSIS 🌸

#include <roaraudio.h>

ssize_t roar_vs_read (roar_vs_t * vss,       void * buf, size_t len, int
* error);

ssize_t roar_vs_write(roar_vs_t * vss, const void * buf, size_t len, int
* error);

like, that's the whole vibe right there πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

roar_vs_read() reads data from the sound server into the buffer buf. data comes IN, you get it, slay ✨

roar_vs_write() writes data in the buffer buf to the sound server. data goes OUT, you sent it, iconic πŸ‘‘


πŸŽ€ PARAMETERS πŸŽ€

  • vss β€” the VS object that data is read from or written to. it's the main character of this whole operation, no cap 🌈
  • buf β€” the buffer to read to or write from. it's literally where the bytes live πŸ“¦
  • len β€” the length of the data to be read or written, in byte. yes, byte, singular, that's what it says πŸ’€
  • error β€” a pointer to an integer used to store the error value in case of error. you can pass NULL if you're not using it, but bestie… it is very recommended to use this error value so you can report good error messages to the user. please. for me. πŸ™ˆ

⭐ RETURN VALUE ⭐

On success, these calls return the amount of data read or written. heads up tho β€” this can be smaller than the requested size. that's not a bug, that's just how it is, so don't come for it 😭

On error, -1 is returned. that's the sad path 🫠


πŸ”₯ EXAMPLES πŸ”₯

FIXME

not me putting FIXME in the examples section πŸ’€ the docs said "we'll do it later" and then simply did not. the audacity. anyway bestie, the examples are FIXME, that's the whole content, I'm just the messenger 🌸

πŸ‘‘ SEE ALSO πŸ‘‘

go read those too, they're giving lore πŸ“š


and that's the page!! RoarAudio, May 2011 β€” yeah this one's been around a minute, it's vintage and we love her for it πŸŽ€πŸ’œ byeee πŸ¦‹βœ¨

πŸ“¦ where this page comes from