roar_simple_play(3)

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

πŸ’– roar_simple_play(3) β€” the System Manager's Manual: RoarAudio edition πŸ’–

okay bestie, gather round, we're doing the RoarAudio simple-stream girlies today. this is roar_simple_play(3) from the RoarAudio manual, and yes she's a little vintage, but she ATE back in the day. let's get into it πŸ’…


✨ NAME ✨

roar_simple_play, roar_simple_monitor, roar_simple_record, roar_simple_filter β€” simple playback, monitoring, recording or filtering via RoarAudio πŸŽ€

(and yes, the original page says "monetoring" but we all know what she meant, love her for it 🫢)


🌸 SYNOPSIS 🌸

#include <roaraudio.h>

int roar_simple_play(int rate, int channels, int bits, int codec, char * server, char * name);

int roar_simple_monitor(int rate, int channels, int bits, int codec, char * server, char * name);

int roar_simple_record(int rate, int channels, int bits, int codec, char * server, char * name);

int roar_simple_filter(int rate, int channels, int bits, int codec, char * server, char * name);

four little functions, one shared vibe. no cap. ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

so what she does is: she opens a connection to the roard(1) and creates a brand new stream for playback, monitoring, recording or filtering. that's the whole job. simple, iconic, does exactly what it says on the tin πŸ‘‘

when you're done with the stream you need to close the connection with roar_simple_close(3). like, you need to. it's not optional, bestie.

and if you just... do nothing with the stream? yeah, the server will kick your connection. brutal. and in the case of playback, it'll warn the user about underruns. so don't ghost your stream, she will notice 😭

⚠️ BIG IMPORTANT ONE: these functions were removed in version 1.0beta0-pr0. they're gone, girl. please upgrade to the VS API β€” go look at roar_vs_new_simple(3). this is not a drill πŸ’€

πŸ’œ PARAMETERS πŸ’œ

  • rate β€” the sample rate of the stream. like, how many samples per second, the tempo of your little audio moment 🎡
  • channels β€” the number of channels in the stream. (the original spells it "nummber", and honestly? iconic typo, but it's the channel count bestie.)
  • bits β€” the number of bits per sample of the stream. the common values are 8 and 16.
  • codec β€” the codec of the data you stream to the server. and hear me on this one: this has nothing to do with the codec of the file you're playing back or encoding. completely different thing. the default (ROAR_CODEC_DEFAULT) is ROAR_CODEC_PCM_S_BE, which is signed PCM in big endian. periodt ✨
  • server β€” the name of the server. a value of NULL (the common case, fr fr) is used to try the default locations.
  • name β€” the name of the process opening this stream, so it gets listed in the server's meta data. should normally be the name of the player β€” no path, no filename of the thing being played, just the name. if it's NULL, an internal default gets used. πŸŽ€

🧚 NOTES ON FILTER STREAMS 🧚

filtering streams should not be expected to work with different audio data than whatever the server itself is working with. so before you open the stream, get the values via roar_server_oinfo(3). check first, open second, that's the rule 🌈


⭐ RETURN VALUE ⭐

  • on success, these calls return a filehandle for the stream 🫢
  • on error, -1 is returned. sadness. πŸ’€

πŸ”₯ EXAMPLES πŸ”₯

examples of these calls are the tools roarcat(1), roarmon(1), roarrec(1) and roarfilt(1). just go look at their code (the original says "there code", we love her). they aren't that complex β€” genuinely, go peek, it's giving readable πŸ‘€


🌈 SEE ALSO 🌈

roar_vs_new_simple(3), roarcat(1), roarmon(1), roarrec(1), roarfilt(1), roar_server_oinfo(3), roar_simple_close(3), libroar(7), RoarAudio(7).


and that's the page bestie!! πŸŽ€ this one's from the RoarAudio crew, manual page dated July 2012 β€” a whole era, truly. if you're out here calling these functions in the year of our lord, please upgrade to the VS API, i am literally begging πŸ™ˆπŸ’–

mwah, go close your connections πŸ’…βœ¨

πŸ“¦ where this page comes from