roar_vs_new_simple(3)
π roar_vs_new_simple β bestie, let's make a VS object π
okay so this is page roar_vs_new_simple(3) from the RoarAudio Programmer's Manual and it's literally about birthing brand-new VS objects. we're so back.
β¨ NAME β¨
roar_vs_new_simple, roar_vs_new_playback β Create new VS objects π«Ά
β¨ SYNOPSIS β¨
#include <roaraudio.h>
roar_vs_t * roar_vs_new_simple(const char * server, const char * name,
int rate, int channels, int codec, int bits, int dir, int * error);
roar_vs_t * roar_vs_new_playback(const char * server, const char * name,
int rate, int channels, int codec, int bits, int * error);
β¨ DESCRIPTION β¨
So these two functions make you a shiny new VS object, and here's the slay: it already comes with a connected data connection. no extra steps, no vibes check needed, it just connects for you π
They connect to the server server using the application name name. and they take all your audio parameters as arguments: rate, channels, codec, bits. iconic.
roar_vs_new_simple() is the flexible one β it takes the stream direction as the parameter dir. you get to pick where the audio is going, main character energy fr fr.
roar_vs_new_playback() is basically roar_vs_new_simple()'s chill twin, except it doesn't take a direction parameter at all β it just uses ROAR_DIR_PLAY (waveform playback) automatically. the original says "expect that" btw, which is a lil typo moment, but the meaning is except that, we understood the assignment π. also important: it may be implemented as a macro, so no cap, don't be surprised.
β¨ PARAMETERS β¨
serverβ the server you're connecting to. passNULLand it'll use the defaults, easy peasy πΈnameβ the application name. this should be something a human can actually use to identify the app, yk? and listen: it MUST NOT be the application's binary name or the value ofargv[0]. not the vibe. do not do that π«rate,channels,codec,bitsβ the audio parameters for your new stream: sampling rate, number of channels per frame, the codec being used, and number of bits per sample. the whole glow-up package β¨dirβ the stream direction. common values includeROAR_DIR_PLAYfor waveform playback,ROAR_DIR_MONITORfor waveform monitoring, andROAR_DIR_RECORDfor waveform recording. for MIDI you'd useROAR_DIR_MIDI_INandROAR_DIR_MIDI_OUT. pick your fighter πerrorβ a pointer to an integer where the error value gets stored if something goes wrong. you can passNULLif you're not using it, but honestly? highly recommended to use it so you can give the user good error messages. bestie, be kind to your users π₯Ί
β¨ RETURN VALUE β¨
On success, these calls hand you a brand-new VS object β slay π
On error, NULL is returned. that's it. that's the whole story. π
β¨ EXAMPLES β¨
FIXME
(yeah. it says FIXME. the docs said "we'll do it later" and honestly? relatable. not me being the example section π)
β¨ SEE ALSO β¨
roar_vs_new(3), roar_vs_new_from_file(3), roar_vs_close(3), roarvs(7), libroar(7), RoarAudio(7).
go read those too, iykyk π¦
RoarAudio Β· June 2011 Β· that's the source, the version and the date, so consider yourself signed off β mwah, go write some audio code bestie ππβ¨
π¦ 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