roar_vs_sync(3)
π roar_vs_sync(3) β the RoarAudio Programmer's Manual π
okay bestie, sit down, we're learning roar_vs_sync today and honestly? it's giving "flushing my whole vibe to the server". this is part of the RoarAudio Programmer's Manual, so you already know it's about talking to your audio server. let's go π
β¨ NAME β¨
roar_vs_sync β sync that VS object with the server, periodt π
πΈ SYNOPSIS πΈ
#include <roaraudio.h>
int roar_vs_sync (roar_vs_t * vss, int wait, int * error);
that's it, that's the whole vibe. three args, one int back π¦
π«Ά DESCRIPTION π«Ά
so like. this function syncs your local data buffers with the server by flushing them. that's the whole job. it takes your buffered stuff and pushes it out there so the server actually sees it. iconic behavior honestly.
the wait parameter is the drama of it all β it tells the function whether it should also wait for the flushed data to actually be played. other sound systems call this drain, iykyk. and listen: this mode is not recommended except at the very end of the stream, because it will literally result in buffer underruns. like, that's not a maybe. it's a will. so don't be messy about it π
and a super important lil note that people always miss: this function only flushes IO buffers, not the ring buffers when you're in buffered mode. if that's what you need, go call roar_vs_iterate(3) or roar_vs_run(3) instead. don't come for this function, it does exactly what it says on the tin β¨
π PARAMETERS π
vssβ the VS object you want to be synced. your main character, basically πwaitβ says whether the call should block until all the data has been played. it must beROAR_VS_WAITorROAR_VS_NOWAIT. no other options, no in-between, pick a lane π¦errorβ a pointer to anintwhere the error value gets stashed if something goes wrong. it can beNULLif you're not using it, but bestie... it is very recommended that you use it, because that's how you report good error messages to your user. don't leave your users out here confused π
β RETURN VALUE β
- on success? these calls return
0. we love a clean zero π - on error?
-1is returned. and that's when you're glad you passed in thaterrorpointer fr fr π
π NOTES π
this function uses the WAIT protocol command when wait is set to ROAR_VS_WAIT. and heads up β this is not supported by all servers. so if you go poking at that and nothing happens, it might not be you. it's the server. not you, babe π«Ά
π§ EXAMPLES π§
FIXME
...yeah. that's what it says. the docs said FIXME. we respect the FIXME. π
π SEE ALSO π
go read those too, they're all part of the family πΈ
and that's the whole page bestie!! stay synced, stay flushed, and please don't drain unless it's the end of the stream ππ
β written by RoarAudio, dated May 2011, and it's still serving to this very day. slay π β¨
π¦ 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