roar_vs_buffer(3)
π roar_vs_buffer(3) β the RoarAudio Programmer's Manual, but make it make sense π
okay bestie, so this is one of those pages from the RoarAudio programmer's manual (that's the roar_vs_* family, iykyk) and it's all about buffered mode on your VS object. lowkey niche, but let's get into it π«Ά
β¨ NAME β¨
roar_vs_buffer β the way you turn on and poke at buffered mode streams π
πΈ SYNOPSIS πΈ
#include <roaraudio.h>
int roar_vs_buffer(roar_vs_t * vss, size_t buffer, int * error);
ssize_t roar_vs_get_avail_read(roar_vs_t * vss, int * error);
ssize_t roar_vs_get_avail_write(roar_vs_t * vss, int * error);
int roar_vs_reset_buffer(roar_vs_t * vss, int writering, int
readring, int * error);
π¦ DESCRIPTION π¦
so these functions are the ones that control the buffered mode of the VS object. and likeβ¦ the manpage itself says using this mode is not recommended π so keep that in mind before you go feral with it.
roar_vs_buffer()β this is the one that initializes buffered mode. it takes the size of the buffer as its argument. the size should be a power of two, okay? and the common values people actually use are2048and4096β¨roar_vs_get_avail_read()androar_vs_get_avail_write()β these two return the amount of free space in the read buffer and the write buffer respectively. like a lil vibe check on how much room you got left πroar_vs_reset_buffer()β resets the read and/or write buffer. and what does "reset" mean here, bestie? it means the data in the buffers is discarded π this does NOT happen frame aligned and it may result in broken audio. so like, iconic but also dangerous, your call.
π¨ IMPORTANT: buffers are not flushed automatically. to flush them you gotta useroar_vs_iterate(3)orroar_vs_run(3). don't forget, or you'll be sitting there like "why is nothing happening" π
π PARAMETERS π
vssβ the VS object you're working with. your main character, fr fr.bufferβ the size of the buffer to be used, in bytes.writering,readringβ these select which buffer to reset. must be eitherROAR_VS_TRUEorROAR_VS_FALSE. no in-between, no "maybe", periodt.errorβ a pointer to anintwhere the error value gets stored if something goes wrong. it can beNULLif you're not using it, but honestly it is very recommended to use it so you can report good error messages to the user. be a good citizen π«Ά
β RETURN VALUE β
- on success, these calls return
0. slay. roar_vs_get_avail_read()androar_vs_get_avail_write()return the free space in the corresponding buffer instead β that's their whole thing.- on error,
-1is returned. π
π EXAMPLES π
FIXME
(yes bestie, the original literally just says FIXME. the docs ate and left no crumbs, apparently π)
π SEE ALSO π
roarvs(7), libroar(7), RoarAudio(7).
and that's the whole page, no cap π this one came from the RoarAudio manual and it's dated June 2011 β so it's been serving buffered-mode realness for a minute πΈ stay hydrated, flush your buffers, and use roar_vs_iterate(3) or `roar_vs_run(3), mwah πβ¨
π¦ where this page comes from
- ubuntu jammy: libroar-dev 1.0~beta12-4 Β· GPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms